From 3840127a3de315fa2a2471ddf1e23575f2608373 Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Thu, 5 Mar 2026 22:00:07 +0100 Subject: Simplify code --- oryxc/src/compiler.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'oryxc/src/compiler.rs') diff --git a/oryxc/src/compiler.rs b/oryxc/src/compiler.rs index a9119bc..dffb941 100644 --- a/oryxc/src/compiler.rs +++ b/oryxc/src/compiler.rs @@ -244,15 +244,12 @@ fn worker_loop( stealers: Arc<[Stealer]>, ) { loop { - if state.njobs.load(Ordering::Acquire) == 0 { - break; - } - let Some(job) = find_task(&queue, &state.globalq, &stealers) else { - // no work available; check termination condition before parking to - // avoid missed wakeups + /* No work available; check termination condition before + * parking to avoid missed wakeups */ if state.njobs.load(Ordering::Acquire) == 0 { - break; + state.wake_all(); + return; } thread::park(); continue; -- cgit v1.2.3