Skip to content

Commit 34c878b

Browse files
committed
fix doc in library/core/src/sync/atomic.rs
Signed-off-by: xizheyin <[email protected]>
1 parent 474351c commit 34c878b

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

Diff for: core/src/sync/atomic.rs

+5-5
Original file line numberDiff line numberDiff line change
@@ -3997,24 +3997,24 @@ unsafe fn atomic_umin<T: Copy>(dst: *mut T, val: T, order: Ordering) -> T {
39973997
///
39983998
/// A fence 'A' which has (at least) [`Release`] ordering semantics, synchronizes
39993999
/// with a fence 'B' with (at least) [`Acquire`] semantics, if and only if there
4000-
/// exist operations X and Y, both operating on some atomic object 'M' such
4000+
/// exist operations X and Y, both operating on some atomic object 'm' such
40014001
/// that A is sequenced before X, Y is sequenced before B and Y observes
4002-
/// the change to M. This provides a happens-before dependence between A and B.
4002+
/// the change to m. This provides a happens-before dependence between A and B.
40034003
///
40044004
/// ```text
40054005
/// Thread 1 Thread 2
40064006
///
40074007
/// fence(Release); A --------------
4008-
/// x.store(3, Relaxed); X --------- |
4008+
/// m.store(3, Relaxed); X --------- |
40094009
/// | |
40104010
/// | |
4011-
/// -------------> Y if x.load(Relaxed) == 3 {
4011+
/// -------------> Y if m.load(Relaxed) == 3 {
40124012
/// |-------> B fence(Acquire);
40134013
/// ...
40144014
/// }
40154015
/// ```
40164016
///
4017-
/// Note that in the example above, it is crucial that the accesses to `x` are atomic. Fences cannot
4017+
/// Note that in the example above, it is crucial that the accesses to `m` are atomic. Fences cannot
40184018
/// be used to establish synchronization among non-atomic accesses in different threads. However,
40194019
/// thanks to the happens-before relationship between A and B, any non-atomic accesses that
40204020
/// happen-before A are now also properly synchronized with any non-atomic accesses that

0 commit comments

Comments
 (0)