Standard library header <stdatomic.h> (C11)
From cppreference.com
C
Concurrency support (C11)
Standard Library headers
<stdalign.h> (C11*)
<stdatomic.h> (C11)
<stdbit.h> (C23)
<stdbool.h> (C99*)
<stdckdint.h> (C23)
<stdint.h> (C99)
<stdmchar.h> (C29)
<stdnoreturn.h> (C11*)
<tgmath.h> (C99)
<threads.h> (C11)
<uchar.h> (C11)
<wchar.h> (C95)
<wctype.h> (C95)
This header provides atomic operations, in particular, it's a part of the concurrency support library.
Contents
[edit] Atomic operations
Operations on atomic types
swaps a value with an atomic object if the old value is what is expected, otherwise reads the old value
(function) [edit]
(function) [edit]
Flag type and operations
Initialization
Memory synchronization ordering
Convenience type aliases
Typedef name
Full type name
atomic_bool
(C11)
_Atomic _Bool
atomic_char
(C11)
_Atomic char
atomic_schar
(C11)
_Atomic signed char
atomic_uchar
(C11)
_Atomic unsigned char
atomic_short
(C11)
_Atomic short
atomic_ushort
(C11)
_Atomic unsigned short
atomic_int
(C11)
_Atomic int
atomic_uint
(C11)
_Atomic unsigned int
atomic_long
(C11)
_Atomic long
atomic_ulong
(C11)
_Atomic unsigned long
atomic_llong
(C11)
_Atomic long long
atomic_ullong
(C11)
_Atomic unsigned long long
atomic_char8_t
(C23)
_Atomic char8_t
atomic_char16_t
(C11)
_Atomic char16_t
atomic_char32_t
(C11)
_Atomic char32_t
atomic_wchar_t
(C11)
_Atomic wchar_t
[edit] Synopsis
This section is incomplete
Reason: add more from 7.17 Atomics <stdatomic.h> and B.16 Atomics <stdatomic.h>
Reason: add more from 7.17 Atomics <stdatomic.h> and B.16 Atomics <stdatomic.h>
#define __STDC_VERSION_STDATOMIC_H__ 202311L void atomic_init (volatile A* obj, /*C*/ value); /*type*/ kill_dependency (/*type*/ y); void atomic_thread_fence (memory_order order); void atomic_signal_fence (memory_order order); bool atomic_is_lock_free (const volatile A* obj); void atomic_store (volatile A* object, /*C*/ desired); void atomic_store_explicit (volatile A* object, /*C*/ desired, memory_order order); /*C*/ atomic_load (const volatile A* object); /*C*/ atomic_load_explicit (const volatile A* object, memory_order order); /*C*/ atomic_exchange (volatile A* object, /*C*/ desired); /*C*/ atomic_exchange_explicit (volatile A* object, /*C*/ desired, memory_order order); bool atomic_compare_exchange_strong (volatile A* object, /*C*/* expected, /*C*/ desired); bool atomic_compare_exchange_strong_explicit (volatile A* object, /*C*/* expected, /*C*/ desired, memory_order success, memory_order failure); bool atomic_compare_exchange_weak (volatile A* object, /*C*/* expected, /*C*/ desired); bool atomic_compare_exchange_weak_explicit (volatile A* object, /*C*/* expected, /*C*/ desired, memory_order success, memory_order failure); /*C*/ /*atomic_fetch_key*/(volatile A* object, M operand); /*C*/ /*atomic_fetch_key_explicit*/(volatile A* object, M operand, memory_order order); bool atomic_flag_test_and_set (volatile atomic_flag * object); bool atomic_flag_test_and_set_explicit (volatile atomic_flag * object, memory_order order); void atomic_flag_clear (volatile atomic_flag * object); void atomic_flag_clear_explicit (volatile atomic_flag * object, memory_order order);