Rollup merge of #74910 - RalfJung:fence, r=Mark-Simulacrum
fence docs: fix example Mutex Fixes https://github.com/rust-lang/rust/issues/74808 Cc @pca006132
This commit is contained in:
commit
2050128302
@ -2649,7 +2649,8 @@ unsafe fn atomic_umin<T: Copy>(dst: *mut T, val: T, order: Ordering) -> T {
|
||||
/// }
|
||||
///
|
||||
/// pub fn lock(&self) {
|
||||
/// while !self.flag.compare_and_swap(false, true, Ordering::Relaxed) {}
|
||||
/// // Wait until the old value is `false`.
|
||||
/// while self.flag.compare_and_swap(false, true, Ordering::Relaxed) != false {}
|
||||
/// // This fence synchronizes-with store in `unlock`.
|
||||
/// fence(Ordering::Acquire);
|
||||
/// }
|
||||
|
Loading…
Reference in New Issue
Block a user