We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent c8b6430 commit 393a009Copy full SHA for 393a009
1 file changed
src/flag.rs
@@ -40,14 +40,14 @@ macro_rules! impl_flag {
40
41
/// Flip the current value and return the new value
42
pub fn flip(&self) -> bool {
43
- let mut current = self.get();
+ let mut current = self.0.load(Ordering::Relaxed);
44
loop {
45
let new = !current;
46
match self.0.compare_exchange_weak(
47
current,
48
new,
49
Ordering::AcqRel,
50
- Ordering::Acquire,
+ Ordering::Relaxed,
51
) {
52
Ok(_) => return new,
53
Err(previous) => current = previous,
0 commit comments