Skip to content

Commit 4825440

Browse files
committed
Wordsmithing & polishing
* Changes: - Align the description of all 3 ways on the most structured form. - Use atomic operation when mentioning Acquire or Release, and otherwise atomic read or atomic write, as appropriate. * Motivation: As per code review feedback, the most structured form is the preferred form. Furthermore, during the switch, it was noted that the use of read/load or write/store was inconsistent. Since cppreference use the terms read/written to refer to the Relaxed atomic operations, the terms read/write are now used: they have the benefit of applying equally well to load/store and to RMW operations.
1 parent 272365b commit 4825440

File tree

1 file changed

+15
-12
lines changed

1 file changed

+15
-12
lines changed

library/core/src/sync/atomic.rs

Lines changed: 15 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -4292,10 +4292,13 @@ unsafe fn atomic_umin<T: Copy>(dst: *mut T, val: T, order: Ordering) -> T {
42924292
///
42934293
/// An atomic operation on one thread will synchronize with a fence on another thread when:
42944294
///
4295-
/// - An atomic operation 'X' with (at least) [`Release`] ordering semantics on some atomic object
4296-
/// 'm' on thread 1,
4297-
/// - is paired on thread 2 with an atomic read 'Y' with any order on 'm',
4298-
/// - followed by a fence 'B' with (at least) [`Acquire`] ordering semantics.
4295+
/// - on thread 1:
4296+
/// - an atomic operation 'X' with (at least) [`Release`] ordering semantics on some atomic
4297+
/// object 'm',
4298+
///
4299+
/// - is paired on thread 2 with:
4300+
/// - an atomic read 'Y' with any order on 'm',
4301+
/// - followed by a fence 'B' with (at least) [`Acquire`] ordering semantics.
42994302
///
43004303
/// This provides a happens-before dependence between X and B.
43014304
///
@@ -4315,12 +4318,12 @@ unsafe fn atomic_umin<T: Copy>(dst: *mut T, val: T, order: Ordering) -> T {
43154318
///
43164319
/// A fence on one thread will synchronize with an atomic operation on another thread when:
43174320
///
4318-
/// - a fence 'A' with (at least) [`Release`] ordering semantics,
4319-
/// - followed by an atomic store 'X' with any ordering on some atomic object 'm',
4320-
///
4321-
/// on thread 1 is paired on thread 2 with:
4321+
/// - on thread:
4322+
/// - a fence 'A' with (at least) [`Release`] ordering semantics,
4323+
/// - followed by an atomic write 'X' with any ordering on some atomic object 'm',
43224324
///
4323-
/// - an atomic operation 'Y' with (at least) [`Acquire`] ordering semantics.
4325+
/// - is paired on thread 2 with:
4326+
/// - an atomic operation 'Y' with (at least) [`Acquire`] ordering semantics.
43244327
///
43254328
/// This provides a happens-before dependence between A and Y.
43264329
///
@@ -4342,10 +4345,10 @@ unsafe fn atomic_umin<T: Copy>(dst: *mut T, val: T, order: Ordering) -> T {
43424345
///
43434346
/// - on thread 1:
43444347
/// - a fence 'A' which has (at least) [`Release`] ordering semantics,
4345-
/// - followed by an atomic store 'X' with any ordering on some atomic object 'm',
4348+
/// - followed by an atomic write 'X' with any ordering on some atomic object 'm',
43464349
///
4347-
/// - is paired on thread 2:
4348-
/// - an atomic operation 'Y' with any ordering on 'm',
4350+
/// - is paired on thread 2 with:
4351+
/// - an atomic read 'Y' with any ordering on 'm',
43494352
/// - followed by a fence 'B' with (at least) [`Acquire`] ordering semantics.
43504353
///
43514354
/// This provides a happens-before dependence between A and B.

0 commit comments

Comments
 (0)