If the macro constant__STDC_NO_ATOMICS__(C11) is defined by the compiler, the header<stdatomic.h>, the keyword_Atomic, and all of the names listed here are not provided.
Contents |
Defined in header <stdatomic.h> | |
(C11) | defines memory ordering constraints (enum)[edit] |
(C11) | lock-free atomic boolean flag (struct)[edit] |
Defined in header <stdatomic.h> | |
| indicates that the given atomic type is lock-free (macro constant)[edit] | |
(C11) | initializes a newatomic_flag (macro constant)[edit] |
(C11)(deprecated in C17)(removed in C23) | initializes a new atomic object (function macro)[edit] |
(C11) | breaks a dependency chain formemory_order_consume (function macro)[edit] |
Defined in header <stdatomic.h> | |
| sets an atomic_flag to true and returns the old value (function)[edit] | |
| sets an atomic_flag to false (function)[edit] | |
(C11) | initializes an existing atomic object (function)[edit] |
(C11) | indicates whether the atomic object is lock-free (function)[edit] |
| stores a value in an atomic object (function)[edit] | |
| reads a value from an atomic object (function)[edit] | |
| swaps a value with the value of an atomic object (function)[edit] | |
| swaps a value with an atomic object if the old value is what is expected, otherwise reads the old value (function)[edit] | |
| atomic addition (function)[edit] | |
| atomic subtraction (function)[edit] | |
| atomic bitwise OR (function)[edit] | |
| atomic bitwise exclusive OR (function)[edit] | |
| atomic bitwise AND (function)[edit] | |
(C11) | generic memory order-dependent fence synchronization primitive (function)[edit] |
(C11) | fence between a thread and a signal handler executed in the same thread (function)[edit] |
The standard library offers convenience typedefs for thecore language atomic types.
| Typedef name | Full type name |
atomic_bool | _Atomic _Bool |
atomic_char | _Atomicchar |
atomic_schar | _Atomicsignedchar |
atomic_uchar | _Atomicunsignedchar |
atomic_short | _Atomicshort |
atomic_ushort | _Atomicunsignedshort |
atomic_int | _Atomicint |
atomic_uint | _Atomicunsignedint |
atomic_long | _Atomiclong |
atomic_ulong | _Atomicunsignedlong |
atomic_llong | _Atomiclonglong |
atomic_ullong | _Atomicunsignedlonglong |
atomic_char8_t(C23) | _Atomic char8_t |
atomic_char16_t | _Atomic char16_t |
atomic_char32_t | _Atomic char32_t |
atomic_wchar_t | _Atomicwchar_t |
atomic_int_least8_t | _Atomicint_least8_t |
atomic_uint_least8_t | _Atomicuint_least8_t |
atomic_int_least16_t | _Atomicint_least16_t |
atomic_uint_least16_t | _Atomicuint_least16_t |
atomic_int_least32_t | _Atomicint_least32_t |
atomic_uint_least32_t | _Atomicuint_least32_t |
atomic_int_least64_t | _Atomicint_least64_t |
atomic_uint_least64_t | _Atomicuint_least64_t |
atomic_int_fast8_t | _Atomicint_fast8_t |
atomic_uint_fast8_t | _Atomicuint_fast8_t |
atomic_int_fast16_t | _Atomicint_fast16_t |
atomic_uint_fast16_t | _Atomicuint_fast16_t |
atomic_int_fast32_t | _Atomicint_fast32_t |
atomic_uint_fast32_t | _Atomicuint_fast32_t |
atomic_int_fast64_t | _Atomicint_fast64_t |
atomic_uint_fast64_t | _Atomicuint_fast64_t |
atomic_intptr_t | _Atomicintptr_t |
atomic_uintptr_t | _Atomicuintptr_t |
atomic_size_t | _Atomicsize_t |
atomic_ptrdiff_t | _Atomicptrdiff_t |
atomic_intmax_t | _Atomicintmax_t |
atomic_uintmax_t | _Atomicuintmax_t |
C++ documentation forAtomic operations library |