Skip to content

Commit

Permalink
Try to be stricter with atomic ops
Browse files Browse the repository at this point in the history
  • Loading branch information
vrurg committed Nov 26, 2024
1 parent c3b4382 commit b36074f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions fieldx/tests/sync.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,7 @@ fn threaded() {
thandles.push(s.spawn(move |_| {
twg.wait();
let mut i = 0;
while !tstop.load(Ordering::Relaxed) {
while !tstop.load(Ordering::SeqCst) {
i += 1;
eprintln!("[{:>4}] {:?}", thread_id, scopy.foo().clone());
assert_eq!(*scopy.foo(), (*texpect.lock().clone()), "foo value");
Expand All @@ -127,7 +127,7 @@ fn threaded() {

wg.wait();
std::thread::sleep(time::Duration::from_millis(100));
stop.store(true, Ordering::Relaxed);
stop.store(true, Ordering::SeqCst);
for thandle in thandles {
thandle.join().expect("thread join failed");
}
Expand Down

0 comments on commit b36074f

Please sign in to comment.