Migrate standard library away from compare_and_swap
This commit is contained in:
parent
4252e48256
commit
828d4ace4d
15 changed files with 79 additions and 36 deletions
|
@ -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
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue