https://doc.rust-lang.org/std/sync/atomic/struct.AtomicU32.h...
It's accepted by the compiler, but if provided, it compiles to a panic.
It's accepted by the compiler, but if provided, it compiles to a panic.
let x = atomic::AtomicU32::new(0);
x.compare_exchange_weak(
0,
1,
atomic::Ordering::AcqRel,
atomic::Ordering::Relaxed).unwrap();
println!("{}", x.load(atomic::Ordering::Relaxed));