pub enum AtomicOp {
Load,
Store,
Exchange,
CompareExchange {
weak: bool,
},
SyncCompareSwap {
value_is_old: bool,
},
Rmw {
op: AtomicRmw,
returns_new: bool,
},
TestAndSet,
Clear,
Fence {
signal: bool,
},
}Expand description
The operation an ExprKind::Atomic performs.
Variants§
Load
An atomic load, whose value has the object’s type.
Store
An atomic store, whose value is void.
Exchange
An atomic exchange, whose value is the old one.
CompareExchange
A compare-and-exchange whose value is _Bool, writing the value it
observed back through the expected pointer when it fails — C11’s
atomic_compare_exchange_strong and GCC’s
__atomic_compare_exchange_n.
SyncCompareSwap
The older __sync_bool_compare_and_swap and
__sync_val_compare_and_swap, whose expected value is a value rather
than a pointer and which write nothing back.
Fields
Rmw
A read-modify-write, whose value is the old one for fetch_op and the
new one for op_fetch.
Fields
TestAndSet
__atomic_test_and_set: an atomic exchange of “set” into a byte, whose
value is what was there before, as a _Bool.
Clear
__atomic_clear: an atomic store of zero into a byte.
Fence
A fence, which has no operand at all.