ATOMIC_VAR_INIT

Defined in header <stdatomic.h> #define ATOMIC_VAR_INIT(value) /* unspecified */ (since C11) Expands to an expression that can be used to initialize an atomic variable of the same type as value. The initial value of atomic object of automatic storage duration that is not initialized using this macro is undefined. The default (zero) initialization of static and thread-local variables produces valid value however. If this macro is not used for initialization of an atomic vari

atomic_thread_fence

Defined in header <stdatomic.h> void atomic_thread_fence( memory_order order ); (since C11) Establishes memory synchronization ordering of non-atomic and relaxed atomic accesses, as instructed by order, without an associated atomic operation. For example, all non-atomic and relaxed atomic stores that happen before a memory_order_release fence in thread A will be synchronized with non-atomic and relaxed atomic loads from the same locations made in thread B after an memory_or

atomic_store

Defined in header <stdatomic.h> void atomic_store( volatile A* obj , C desired); (1) (since C11) void atomic_store_explicit( volatile A* obj, C desired, memory_order order ); (2) (since C11) Atomically replaces the value of the atomic variable pointed to by obj with desired. The operation is atomic write operation. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order. order must be one

atomic_signal_fence

Defined in header <stdatomic.h> void atomic_signal_fence( memory_order order ); (since C11) Establishes memory synchronization ordering of non-atomic and relaxed atomic accesses, as instructed by order, between a thread and a signal handler executed on the same thread. This is equivalent to std::atomic_thread_fence, except no CPU instructions for memory ordering are issued. Only reordering of the instructions by the compiler is suppressed as order instructs. For example, wr

atomic_load

Defined in header <stdatomic.h> C atomic_load( const volatile A* obj ); (1) (since C11) C atomic_load_explicit( const volatile A* obj, memory_order order ); (2) (since C11) Atomically loads and returns the current value of the atomic variable pointed to by obj. The operation is atomic read operation. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order. order must be one of memory_orde

atomic_is_lock_free

Defined in header <stdatomic.h> _Bool atomic_is_lock_free( const volatile A* obj ); (since C11) Determines if the atomic operations on all objects of the type A (the type of the object pointed to by obj) are lock-free. In any given program execution, the result of calling atomic_is_lock_free is the same for all pointers of the same type. This is a generic function defined for all atomic object types A. The argument is pointer to a volatile atomic type to accept addresses of

atomic_init

Defined in header <stdatomic.h> void atomic_init( volatile A* obj, C desired ); (since C11) Initializes the default-constructed atomic object object with the value desired. The function is not atomic: concurrent access from another thread, even through an atomic operation, is a data race. This is a generic function defined for all atomic object types A. The argument is pointer to a volatile atomic type to accept addresses of both non-volatile and volatile (e.g. memory-mappe

atomic_flag_test_and_set

Defined in header <stdatomic.h> _Bool atomic_flag_test_and_set( volatile atomic_flag* obj ); (1) (since C11) _Bool atomic_flag_test_and_set_explicit( volatile atomic_flag* obj, memory_order order ); (2) (since C11) Atomically changes the state of a atomic_flag pointed to by obj to set (true) and returns the previous value. The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order. The argum

ATOMIC_FLAG_INIT

Defined in header <stdatomic.h> #define ATOMIC_FLAG_INIT /* unspecified */ (since C11) Expands to an expression that can be used to initialize atomic_flag type. The value atomic_flag that is not initialized using this macro is undefined. References C11 standard (ISO/IEC 9899:2011): 7.17.1/3 ATOMIC_FLAG_INIT (p: 273) 7.17.8/4 ATOMIC_FLAG_INIT (p: 285) See also ATOMIC_VAR_INIT (C11) initializes a new atomic object (function macro)

atomic_flag_clear

Defined in header <stdatomic.h> void atomic_flag_clear( volatile atomic_flag* obj ); (1) (since C11) void atomic_flag_clear_explicit( volatile atomic_flag* obj, memory_order order ); (2) (since C11) Atomically changes the state of a atomic_flag pointed to by obj to clear (false). The first version orders memory accesses according to memory_order_seq_cst, the second version orders memory accesses according to order. The argument is pointer to a volatile atomic flag to