Skip to content

Commit

Permalink
Rollup merge of #74910 - RalfJung:fence, r=Mark-Simulacrum
Browse files Browse the repository at this point in the history
fence docs: fix example Mutex

Fixes #74808

Cc @pca006132
  • Loading branch information
Manishearth authored Jul 29, 2020
2 parents 1d53340 + 897149a commit 2050128
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion library/core/src/sync/atomic.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
/// }
Expand Down

0 comments on commit 2050128

Please sign in to comment.