Skip to content

Commit

Permalink
add fence to io thread
Browse files Browse the repository at this point in the history
  • Loading branch information
vchuravy committed Oct 20, 2023
1 parent 78a817d commit e2849c6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/threading.c
Original file line number Diff line number Diff line change
Expand Up @@ -709,13 +709,15 @@ void jl_utility_io_threadfun(void *arg)
jl_ptls_t ptls = jl_current_task->ptls;
int8_t gc_state = jl_gc_safe_enter(ptls);
while (1) {
jl_fence(); // [^store_buffering_2]
if (jl_atomic_load_relaxed(&jl_uv_n_waiters) == 0)
{
if (JL_UV_TRYLOCK_NOGC())
{
jl_process_events_locked();
JL_UV_UNLOCK_NOGC();
}
// TODO: jl_fence(); // [^store_buffering_2]
}
}
jl_gc_safe_leave(ptls, gc_state);
return;
Expand Down

0 comments on commit e2849c6

Please sign in to comment.