#[non_exhaustive]pub enum Ordering {
Relaxed,
Release,
Acquire,
AcqRel,
SeqCst,
}
Expand description
Atomic memory orderings
Memory orderings specify the way atomic operations synchronize memory.
In its weakest Ordering::Relaxed
, only the memory directly touched by the
operation is synchronized. On the other hand, a store-load pair of Ordering::SeqCst
operations synchronize other memory while additionally preserving a total order of such
operations across all threads.
Rust’s memory orderings are the same as those of C++20.
For more information see the nomicon.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.