Skip to content

Commit

Permalink
Apply suggestions from code review
Browse files Browse the repository at this point in the history
Co-authored-by: Alex Arslan <ararslan@comcast.net>
Co-authored-by: Valentin Churavy <vchuravy@users.noreply.github.com>
  • Loading branch information
3 people authored Dec 7, 2023
1 parent cffbe7a commit b4b8141
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 6 deletions.
2 changes: 1 addition & 1 deletion src/jl_uv.c
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ static void jl_uv_closeHandle(uv_handle_t *handle)
return;
}
if (handle == (uv_handle_t*)&wait_empty_worker)
handle->type = 0;
handle->type = UV_UNKNOWN_HANDLE;
else if (handle == (uv_handle_t*)&signal_async)
return;
else
Expand Down
6 changes: 1 addition & 5 deletions src/scheduler.c
Original file line number Diff line number Diff line change
Expand Up @@ -272,9 +272,7 @@ static int wake_thread(int16_t tid) JL_NOTSAFEPOINT
int wasrunning = jl_atomic_fetch_add_relaxed(&nrunning, 1); // increment in-flight wakeup count
assert(wasrunning); (void)wasrunning;
JL_PROBE_RT_SLEEP_CHECK_WAKE(ptls2, state);
uv_mutex_lock(&ptls2->sleep_lock);
uv_cond_signal(&ptls2->wake_signal);
uv_mutex_unlock(&ptls2->sleep_lock);
return 1;
}
}
Expand Down Expand Up @@ -587,9 +585,7 @@ void scheduler_delete_thread(jl_ptls_t ptls) JL_NOTSAFEPOINT
jl_ptls_t ptls2 = jl_atomic_load_relaxed(&jl_all_tls_states)[0];
// This was the last running thread, and there is no thread with !may_sleep
// so make sure tid 0 is notified to check wait_empty
uv_mutex_lock(&ptls2->sleep_lock);
uv_cond_wait(&ptls2->wake_signal, &ptls->sleep_lock);
uv_mutex_unlock(&ptls2->sleep_lock);
uv_cond_signal(&ptls2->wake_signal);
}
}
jl_fence();
Expand Down

0 comments on commit b4b8141

Please sign in to comment.