pub enum MemOrder {
Relaxed,
Acquire,
Release,
AcqRel,
SeqCst,
}Expand description
A memory order, C11 7.17.3’s memory_order and Rust’s Ordering.
memory_order_consume is not here: no compiler implements dependency
ordering and Rust has no Consume, so it arrives as MemOrder::Acquire
— which is what GCC and Clang also emit for it, and what C11 7.17.3p1
allows an implementation to do.
Variants§
Relaxed
memory_order_relaxed
Acquire
memory_order_acquire (and memory_order_consume).
Release
memory_order_release
AcqRel
memory_order_acq_rel
SeqCst
memory_order_seq_cst
Implementations§
Source§impl MemOrder
impl MemOrder
Sourcepub fn valid_for_load(self) -> bool
pub fn valid_for_load(self) -> bool
Whether a load may be performed with this order (C11 7.17.7.2p3).
Sourcepub fn valid_for_store(self) -> bool
pub fn valid_for_store(self) -> bool
Whether a store may be performed with this order (C11 7.17.7.1p2).
Sourcepub fn strength(self) -> u8
pub fn strength(self) -> u8
How strong the order is, for the rule that a compare-exchange’s failure order may not be stronger than its success order.
Sourcepub fn failure_order(self) -> MemOrder
pub fn failure_order(self) -> MemOrder
The strongest order a failed compare-exchange may use beside this one,
which is what fetch_update and a nand loop are given.