From e6bf313e419592860ed5087cb76f1261e7a7060c Mon Sep 17 00:00:00 2001 From: romir kulshrestha Date: Wed, 4 Mar 2026 21:34:00 +0100 Subject: race condition fix --- oryxc/src/compiler.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'oryxc/src/compiler.rs') diff --git a/oryxc/src/compiler.rs b/oryxc/src/compiler.rs index c30dbce..4ae8577 100644 --- a/oryxc/src/compiler.rs +++ b/oryxc/src/compiler.rs @@ -171,6 +171,10 @@ where handles.iter().map(|h| h.thread().clone()).collect(); let _ = state.worker_threads.set(worker_threads); + // if work completes before we get here, wake them so they can observe the + // termination condition and exit. + state.wake_all(); + for h in handles { if let Err(e) = h.join() { std::panic::resume_unwind(e) -- cgit v1.2.3