Skip to content

Commit

Permalink
fence docs: fix example Mutex
Browse files Browse the repository at this point in the history
  • Loading branch information
RalfJung committed Jul 29, 2020
1 parent 06e7b93 commit 897149a
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 897149a

Please sign in to comment.