1
Fork 0

Migrate standard library away from compare_and_swap

This commit is contained in:
Linus Färnstrand 2020-11-20 22:27:50 +01:00
parent 4252e48256
commit 828d4ace4d
15 changed files with 79 additions and 36 deletions

View file

@ -17,7 +17,12 @@ impl Drop for D {
fn drop(&mut self) {
println!("Dropping {}", self.0);
let old = LOG.load(Ordering::SeqCst);
LOG.compare_and_swap(old, old << 4 | self.0 as usize, Ordering::SeqCst);
let _ = LOG.compare_exchange(
old,
old << 4 | self.0 as usize,
Ordering::SeqCst,
Ordering::SeqCst
);
}
}