diff --git a/src/jl_uv.c b/src/jl_uv.c index 420fd0cfd42a7..32adf9f1ba8f2 100644 --- a/src/jl_uv.c +++ b/src/jl_uv.c @@ -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 diff --git a/src/scheduler.c b/src/scheduler.c index da8240c68dd07..91740043828fd 100644 --- a/src/scheduler.c +++ b/src/scheduler.c @@ -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; } } @@ -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();