次の方法で共有


<atomic> enums

 

The latest version of this topic can be found at <atomic> enums.

memory_order Enum

memory_order Enum

Supplies symbolic names for synchronization operations on memory locations. These operations affect how assignments in one thread become visible in another.

enum class memory_order {
    memory_order_relaxed,
 memory_order_consume,
    memory_order_acquire,
 memory_order_release,
    memory_order_acq_rel,
 memory_order_seq_cst,
} memory_order;

Remarks

memory_order_relaxed No ordering required.
memory_order_consume A load operation acts as a consume operation on the memory location.
memory_order_acquire A load operation acts as an acquire operation on the memory location.
memory_order_release A store operation acts as a release operation on the memory location.
memory_order_acq_rel Combines memory_order_acquire and memory_order_release.
memory_order_seq_cst Combines memory_order_acquire and memory_order_release. Memory accesses that are marked as memory_order_seq_cst must be sequentially consistent.

See Also

<atomic>