Namespaces
Variants

ATOMIC_*_LOCK_FREE

From cppreference.net
Definido en el encabezado <stdatomic.h>
#define ATOMIC_BOOL_LOCK_FREE     /* implementation-defined */

#define ATOMIC_CHAR_LOCK_FREE     /* implementation-defined */
#define ATOMIC_CHAR16_T_LOCK_FREE /* implementation-defined */
#define ATOMIC_CHAR32_T_LOCK_FREE /* implementation-defined */
#define ATOMIC_WCHAR_T_LOCK_FREE  /* implementation-defined */
#define ATOMIC_SHORT_LOCK_FREE    /* implementation-defined */
#define ATOMIC_INT_LOCK_FREE      /* implementation-defined */
#define ATOMIC_LONG_LOCK_FREE     /* implementation-defined */
#define ATOMIC_LLONG_LOCK_FREE    /* implementation-defined */

#define ATOMIC_POINTER_LOCK_FREE  /* implementation-defined */
(desde C11)
#define ATOMIC_CHAR8_T_LOCK_FREE  /* implementation-defined */
(desde C23)

Se expande a expresiones constantes del preprocesador que evalúan a 0 , 1 , o 2 indicando la propiedad lock-free de los correspondientes tipos atómicos (tanto con signo como sin signo).

Valor Explicación
0 El tipo atómico nunca es lock-free
1 El tipo atómico es a veces lock-free
2 El tipo atómico es siempre lock-free

Referencias

  • Estándar C17 (ISO/IEC 9899:2018):
  • 7.17.1/3 macros atómicas sin bloqueo (p: 200)
  • Estándar C11 (ISO/IEC 9899:2011):
  • 7.17.1/3 atomic lock-free macros (p: 273)