From e2849c6788e3611256119fa7c86e2b79f658fa70 Mon Sep 17 00:00:00 2001 From: Valentin Churavy Date: Mon, 11 Sep 2023 16:43:29 -0400 Subject: [PATCH] add fence to io thread --- src/threading.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/threading.c b/src/threading.c index 12df923e790a8..a82b2bcd6ac44 100644 --- a/src/threading.c +++ b/src/threading.c @@ -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;