diff options
| author | Mara Bos <m-ou.se@m-ou.se> | 2024-03-19 15:17:40 +0100 |
|---|---|---|
| committer | Mara Bos <m-ou.se@m-ou.se> | 2024-03-20 15:38:09 +0100 |
| commit | 34621757ea9437994ef717ac4f1928933a6e1b24 (patch) | |
| tree | 7e8289b89dd088d6fcc4a71c4cc2355892862113 /library/std/src/sync | |
| parent | acddc55748d16559531965785a175e48530cdecd (diff) | |
SeqCst->Relaxed in condvar test.
Relaxed is enough here. Synchronization is done by the mutex.
Diffstat (limited to 'library/std/src/sync')
| -rw-r--r-- | library/std/src/sync/condvar/tests.rs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/library/std/src/sync/condvar/tests.rs b/library/std/src/sync/condvar/tests.rs index 24f467f0b03..12d13a6b20b 100644 --- a/library/std/src/sync/condvar/tests.rs +++ b/library/std/src/sync/condvar/tests.rs @@ -170,14 +170,14 @@ fn wait_timeout_wake() { let t = thread::spawn(move || { let _g = m2.lock().unwrap(); thread::sleep(Duration::from_millis(1)); - notified_copy.store(true, Ordering::SeqCst); + notified_copy.store(true, Ordering::Relaxed); c2.notify_one(); }); let (g, timeout_res) = c.wait_timeout(g, Duration::from_millis(u64::MAX)).unwrap(); assert!(!timeout_res.timed_out()); // spurious wakeups mean this isn't necessarily true // so execute test again, if not notified - if !notified.load(Ordering::SeqCst) { + if !notified.load(Ordering::Relaxed) { t.join().unwrap(); continue; } |
