Skip to content

Commit 94e2089

Browse files
committed
Change test suite atomic from SeqCst to Relaxed
This atomic is not synchronizing anything outside of its own value, so we don't need the Acquire/Release guarantee that all memory operations prior to the store are visible after the subsequent load, nor the SeqCst guarantee of all threads seeing all of the sequentially consistent operations in the same order.
1 parent 42badfd commit 94e2089

File tree

1 file changed

+3
-4
lines changed

1 file changed

+3
-4
lines changed

Diff for: tests/drop/mod.rs

+3-4
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,7 @@
22

33
use std::error::Error as StdError;
44
use std::fmt::{self, Display};
5-
use std::sync::atomic::AtomicBool;
6-
use std::sync::atomic::Ordering::SeqCst;
5+
use std::sync::atomic::{AtomicBool, Ordering};
76
use std::sync::Arc;
87

98
#[derive(Debug)]
@@ -19,7 +18,7 @@ impl Flag {
1918
}
2019

2120
pub fn get(&self) -> bool {
22-
self.atomic.load(SeqCst)
21+
self.atomic.load(Ordering::Relaxed)
2322
}
2423
}
2524

@@ -48,7 +47,7 @@ impl Display for DetectDrop {
4847

4948
impl Drop for DetectDrop {
5049
fn drop(&mut self) {
51-
let already_dropped = self.has_dropped.atomic.swap(true, SeqCst);
50+
let already_dropped = self.has_dropped.atomic.swap(true, Ordering::Relaxed);
5251
assert!(!already_dropped);
5352
}
5453
}

0 commit comments

Comments
 (0)