From c557264c3cfcc3505b33859d52c49f6214c367cc Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Wed, 4 Mar 2026 01:05:13 +0100 Subject: Switch from Ordering::SeqCst to Ordering::Relaxed --- oryxc/src/compiler.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'oryxc/src') 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]>, ) { 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(); } -- cgit v1.2.3