summaryrefslogtreecommitdiff
path: root/oryxc/src/compiler.rs
diff options
context:
space:
mode:
Diffstat (limited to 'oryxc/src/compiler.rs')
-rw-r--r--oryxc/src/compiler.rs11
1 files changed, 4 insertions, 7 deletions
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<Job>]>,
) {
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;