Skip to content

Commit 3462175

Browse files
committed
SeqCst->Relaxed in condvar test.
Relaxed is enough here. Synchronization is done by the mutex.
1 parent acddc55 commit 3462175

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

library/std/src/sync/condvar/tests.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -170,14 +170,14 @@ fn wait_timeout_wake() {
170170
let t = thread::spawn(move || {
171171
let _g = m2.lock().unwrap();
172172
thread::sleep(Duration::from_millis(1));
173-
notified_copy.store(true, Ordering::SeqCst);
173+
notified_copy.store(true, Ordering::Relaxed);
174174
c2.notify_one();
175175
});
176176
let (g, timeout_res) = c.wait_timeout(g, Duration::from_millis(u64::MAX)).unwrap();
177177
assert!(!timeout_res.timed_out());
178178
// spurious wakeups mean this isn't necessarily true
179179
// so execute test again, if not notified
180-
if !notified.load(Ordering::SeqCst) {
180+
if !notified.load(Ordering::Relaxed) {
181181
t.join().unwrap();
182182
continue;
183183
}

0 commit comments

Comments
 (0)