Skip to content

Commit 69c8f35

Browse files
committed
Rollup merge of rust-lang#29132 - sorear:document-ordering-relaxed, r=alexcrichton
I wasn't sure whether `Ordering::Relaxed` meant `Monotonic` or `Unordered`, so I checked the compiler sources and found https://github.com/rust-lang/rust/blob/206af38e74ce7fa4b0e781ece7f1067c018c580e/src/librustc_trans/trans/intrinsic.rs#L846 which appears conclusive. Adding this answer to the documentation.
2 parents 0efbf08 + 1e68c91 commit 69c8f35

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/libcore/sync/atomic.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,8 @@ unsafe impl<T> Sync for AtomicPtr<T> {}
153153
#[stable(feature = "rust1", since = "1.0.0")]
154154
#[derive(Copy, Clone)]
155155
pub enum Ordering {
156-
/// No ordering constraints, only atomic operations.
156+
/// No ordering constraints, only atomic operations. Corresponds to LLVM's
157+
/// `Monotonic` ordering.
157158
#[stable(feature = "rust1", since = "1.0.0")]
158159
Relaxed,
159160
/// When coupled with a store, all previous writes become visible

0 commit comments

Comments
 (0)