summaryrefslogtreecommitdiff
path: root/oryxc/src
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2026-03-04 01:05:13 +0100
committerThomas Voss <mail@thomasvoss.com> 2026-03-04 01:05:13 +0100
commitc557264c3cfcc3505b33859d52c49f6214c367cc (patch)
treeb00b9a06dd0d6a618bf31543c22d059d7b5d7e4a /oryxc/src
parent1250df334aff08bd2a16250b3972535fbac63722 (diff)
Switch from Ordering::SeqCst to Ordering::Relaxed
Diffstat (limited to 'oryxc/src')
-rw-r--r--oryxc/src/compiler.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/oryxc/src/compiler.rs b/oryxc/src/compiler.rs
index a151d94..b8fa7e6 100644
--- a/oryxc/src/compiler.rs
+++ b/oryxc/src/compiler.rs
@@ -96,8 +96,8 @@ where
Err(e) => err!(e, "{}", path.display()),
};
state.files.insert(id, data);
- state.njobs.fetch_add(1, Ordering::SeqCst);
state.globalq.push(Job::LexAndParse { file: id });
+ state.njobs.fetch_add(1, Ordering::Relaxed);
}
let mut workers = Vec::with_capacity(flags.threads);
@@ -144,7 +144,7 @@ fn worker_loop(
stealers: Arc<[Stealer<Job>]>,
) {
loop {
- if state.njobs.load(Ordering::SeqCst) == 0 {
+ if state.njobs.load(Ordering::Relaxed) == 0 {
break;
}
@@ -193,7 +193,7 @@ fn worker_loop(
_ => todo!(),
}
- state.njobs.fetch_sub(1, Ordering::SeqCst);
+ state.njobs.fetch_sub(1, Ordering::Relaxed);
} else {
thread::yield_now();
}