Skip to content

Commit efd2d55

Browse files
committed
review nits
1 parent b6eccc6 commit efd2d55

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

tests/run-pass/atomic.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -88,13 +88,13 @@ fn atomic_fences() {
8888
}
8989

9090
fn weak_sometimes_fails() {
91-
static ATOMIC: AtomicBool = AtomicBool::new(false);
91+
let atomic = AtomicBool::new(false);
9292
let tries = 20;
9393
for _ in 0..tries {
94-
let cur = ATOMIC.load(Relaxed);
94+
let cur = atomic.load(Relaxed);
9595
// Try (weakly) to flip the flag.
96-
if ATOMIC.compare_exchange_weak(cur, !cur, Relaxed, Relaxed).is_err() {
97-
// We succeeded, so return and skip the panic.
96+
if atomic.compare_exchange_weak(cur, !cur, Relaxed, Relaxed).is_err() {
97+
// We failed, so return and skip the panic.
9898
return;
9999
}
100100
}

0 commit comments

Comments
 (0)