Skip to content

Commit 7bda6ad

Browse files
authored
Unrolled build for rust-lang#137585
Rollup merge of rust-lang#137585 - xizheyin:issue-135801, r=workingjubilee Update documentation to consistently use 'm' in atomic synchronization example Fixes rust-lang#135801
2 parents 9fb94b3 + 3835dc2 commit 7bda6ad

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

library/core/src/sync/atomic.rs

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

0 commit comments

Comments
 (0)