SeqCst->Relaxed in condvar test.
Relaxed is enough here. Synchronization is done by the mutex.
This commit is contained in:
parent
acddc55748
commit
34621757ea
1 changed files with 2 additions and 2 deletions
|
@ -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;
|
||||
}
|
||||
|
|
Loading…
Add table
Reference in a new issue