header

<atomic>

Atomic
Atomic types are types that encapsulate a value whose access is guaranteed to not cause data races and can be used to synchronize memory accesses among different threads.

This header declares two C++ classes, atomic and atomic_flag, that implement all the features of atomic types in self-contained classes. The header also declares an entire set of C-style types and functions compatible with the atomic support in C.

Classes


Types


C-style atomic types

The following atomic types are also defined in this header; each with the same behavior as the respective instantiation of atomic for the listed contained type.
contained typeatomic typedescription
boolatomic_bool
charatomic_charatomics for fundamental integral types.
These are either typedefs of the corresponding full specialization of the atomic class template or a base class of such specialization.
signed charatomic_schar
unsigned charatomic_uchar
shortatomic_short
unsigned shortatomic_ushort
intatomic_int
unsigned intatomic_uint
longatomic_long
unsigned longatomic_ulong
long longatomic_llong
unsigned long longatomic_ullong
wchar_tatomic_wchar_t
char16_tatomic_char16_t
char32_tatomic_char32_t
intmax_tatomic_intmax_tatomics for width-based integrals (those defined in <cinttypes>).
Each of these is either an alias of one of the above atomics for fundamental integral types or of a full specialization of the atomic class template with an extended integral type.

Where N is one in 8, 16, 32, 64, or any other type width supported by the library.
uintmax_tatomic_uintmax_t
int_leastN_tatomic_int_leastN_t
uint_leastN_tatomic_uint_leastN_t
int_fastN_tatomic_int_fastN_t
uint_fastN_tatomic_uint_fastN_t
intptr_tatomic_intptr_t
uintptr_tatomic_uintptr_t
size_tatomic_size_t
ptrdiff_tatomic_ptrdiff_t

Functions


Functions for atomic objects (C-style)


Functions for atomic flags (C-style)


Macro functions


Macro constants

macrorelative to typesdefined as
ATOMIC_BOOL_LOCK_FREEbool0 if the types are never lock-free.
1 it the types are sometimes lock-free.
2 if the types are always lock-free.

Consistent with the value returned by atomic::is_lock_free.
ATOMIC_CHAR_LOCK_FREEchar
signed char
unsigned char
ATOMIC_SHORT_LOCK_FREEshort
unsigned short
ATOMIC_INT_LOCK_FREEint
unsigned int
ATOMIC_LONG_LOCK_FREElong
unsigned long
ATOMIC_LLONG_LOCK_FREElong long
unsigned long long
ATOMIC_WCHAR_T_LOCK_FREEwchar_t
ATOMIC_CHAR16_T_LOCK_FREEchar16_t
ATOMIC_CHAR32_T_LOCK_FREEchar32_t
ATOMIC_POINTER_LOCK_FREEU*
(for any type U)
<blockquote id="pwjBlLZ"><tr id="pwjBlLZ"></tr></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect><blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"><option id="pwjBlLZ"></option></delect>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"></mark>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
<nav id="pwjBlLZ"><tr id="pwjBlLZ"><address id="pwjBlLZ"></address></tr></nav>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"></delect>
<mark id="pwjBlLZ"><tr id="pwjBlLZ"></tr></mark>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"></blockquote>
<delect id="pwjBlLZ"><option id="pwjBlLZ"><blockquote id="pwjBlLZ"></blockquote></option></delect>
<blockquote id="pwjBlLZ"><option id="pwjBlLZ"></option></blockquote>
<delect id="pwjBlLZ"></delect>
<delect id="pwjBlLZ"></delect>
  • 629832435 2018-04-20
  • 4254782434 2018-04-20
  • 7642392433 2018-04-20
  • 4201592432 2018-04-20
  • 1221362431 2018-04-20
  • 5455692430 2018-04-20
  • 8345962429 2018-04-20
  • 7297372428 2018-04-20
  • 4929522427 2018-04-20
  • 1938132426 2018-04-20
  • 2267862425 2018-04-20
  • 6177082424 2018-04-20
  • 838232423 2018-04-20
  • 4694502422 2018-04-20
  • 6512882421 2018-04-19
  • 4659652420 2018-04-19
  • 2967832419 2018-04-19
  • 8339042418 2018-04-19
  • 8147112417 2018-04-19
  • 2774752416 2018-04-19