We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 58bafe4 commit 75c10e4Copy full SHA for 75c10e4
src/partr.c
@@ -343,10 +343,12 @@ static int sleep_check_after_threshold(uint64_t *start_cycles)
343
/* ensure thread tid is awake if necessary */
344
JL_DLLEXPORT void jl_wakeup_thread(int16_t tid)
345
{
346
- int16_t self = jl_get_ptls_states()->tid;
+ jl_ptls_t ptls = jl_get_ptls_states();
347
+ int16_t self = ptls->tid;
348
int16_t uvlock = jl_atomic_load_acquire(&jl_uv_mutex.owner);
349
if (tid == self) {
350
// we're already awake, but make sure we'll exit uv_run
351
+ jl_atomic_store(&ptls->sleep_check_state, not_sleeping);
352
if (uvlock == self)
353
uv_stop(jl_global_event_loop());
354
}
0 commit comments