procedure Clear (This : aliased in out Flag;
Order : Mem_Order := Seq_Cst)
type Flag is limited private;
function Init (Val : Boolean) return Flag
Can be used to initialize an Atomic_Flag:
A : Atomic.Flag := Atomic.Init (0);
type Mem_Order is
(Relaxed,
Consume,
Acquire,
Release,
Acq_Rel,
Seq_Cst);
Implies no inter-thread ordering constraints
This is currently implemented using the stronger __ATOMIC_ACQUIRE memory order because of a deficiency in C++11's semantics for memory_order_consume.
Creates an inter-thread happens-before constraint from the release (or stronger) semantic store to this acquire load. Can prevent hoisting of code to before the operation.
Creates an inter-thread happens-before constraint to acquire (or stronger) semantic loads that read from this release store. Can prevent sinking of code to after the operation.
Combines the effects of both Acquire and Release
Enforces total ordering with all other Seq_Cst operations
function Set (This : aliased Flag;
Order : Mem_Order := Seq_Cst)
return Boolean
function Stronger (A, B : Mem_Order) return Boolean
procedure Test_And_Set (This : aliased in out Flag;
Result : out Boolean;
Order : Mem_Order := Seq_Cst)
function Value (This : Flag) return Boolean
Ghost function to get the value of an Flag without needing it aliased. This doesn't use the atomic built-ins.