Movatterモバイル変換


[0]ホーム

URL:


cppreference.com
Namespaces
Variants
    Actions

      Standard library header <stdatomic.h> (C11)

      From cppreference.com
      <c‎ |header
       
       
       

      This header providesatomic operations, in particular, it's a part of theconcurrency support library.

      Contents

      [edit]Atomic operations

      Operations on atomic types
      indicates that the given atomic type is lock-free
      (macro constant)[edit]
      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]
      Flag type and operations
      lock-free atomic boolean flag
      (struct)[edit]
      sets an atomic_flag to true and returns the old value
      (function)[edit]
      sets an atomic_flag to false
      (function)[edit]
      Initialization
      initializes an existing atomic object
      (function)[edit]
      (C11)(deprecated in C17)(removed in C23)
      initializes a new atomic object
      (function macro)[edit]
      initializes a newatomic_flag
      (macro constant)[edit]
      Memory synchronization ordering
      defines memory ordering constraints
      (enum)[edit]
      breaks a dependency chain formemory_order_consume
      (function macro)[edit]
      generic memory order-dependent fence synchronization primitive
      (function)[edit]
      fence between a thread and a signal handler executed in the same thread
      (function)[edit]
      Convenience type aliases
      Typedef name Full type name
      atomic_bool(C11)_Atomic _Bool
      atomic_char(C11)_Atomicchar
      atomic_schar(C11)_Atomicsignedchar
      atomic_uchar(C11)_Atomicunsignedchar
      atomic_short(C11)_Atomicshort
      atomic_ushort(C11)_Atomicunsignedshort
      atomic_int(C11)_Atomicint
      atomic_uint(C11)_Atomicunsignedint
      atomic_long(C11)_Atomiclong
      atomic_ulong(C11)_Atomicunsignedlong
      atomic_llong(C11)_Atomiclonglong
      atomic_ullong(C11)_Atomicunsignedlonglong
      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)_Atomicwchar_t
      atomic_int_least8_t(C11)_Atomicint_least8_t
      atomic_uint_least8_t(C11)_Atomicuint_least8_t
      atomic_int_least16_t(C11)_Atomicint_least16_t
      atomic_uint_least16_t(C11)_Atomicuint_least16_t
      atomic_int_least32_t(C11)_Atomicint_least32_t
      atomic_uint_least32_t(C11)_Atomicuint_least32_t
      atomic_int_least64_t(C11)_Atomicint_least64_t
      atomic_uint_least64_t(C11)_Atomicuint_least64_t
      atomic_int_fast8_t(C11)_Atomicint_fast8_t
      atomic_uint_fast8_t(C11)_Atomicuint_fast8_t
      atomic_int_fast16_t(C11)_Atomicint_fast16_t
      atomic_uint_fast16_t(C11)_Atomicuint_fast16_t
      atomic_int_fast32_t(C11)_Atomicint_fast32_t
      atomic_uint_fast32_t(C11)_Atomicuint_fast32_t
      atomic_int_fast64_t(C11)_Atomicint_fast64_t
      atomic_uint_fast64_t(C11)_Atomicuint_fast64_t
      atomic_intptr_t(C11)_Atomicintptr_t
      atomic_uintptr_t(C11)_Atomicuintptr_t
      atomic_size_t(C11)_Atomicsize_t
      atomic_ptrdiff_t(C11)_Atomicptrdiff_t
      atomic_intmax_t(C11)_Atomicintmax_t
      atomic_uintmax_t(C11)_Atomicuintmax_t

      [edit]Synopsis

      This section is incomplete
      Reason: add more from 7.17 Atomics <stdatomic.h> and B.16 Atomics <stdatomic.h>
      #define __STDC_VERSION_STDATOMIC_H__ 202311L voidatomic_init(volatile A* obj,/*C*/ value);/*type*/kill_dependency(/*type*/ y);voidatomic_thread_fence(memory_order order);voidatomic_signal_fence(memory_order order);boolatomic_is_lock_free(constvolatile A* obj);voidatomic_store(volatile A* object,/*C*/ desired);voidatomic_store_explicit(volatile A* object,/*C*/ desired,memory_order order);/*C*/atomic_load(constvolatile A* object);/*C*/atomic_load_explicit(constvolatile 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);boolatomic_compare_exchange_strong(volatile A* object,/*C*/* expected,/*C*/ desired);boolatomic_compare_exchange_strong_explicit(volatile A* object,/*C*/* expected,/*C*/ desired,memory_order success,memory_order failure);boolatomic_compare_exchange_weak(volatile A* object,/*C*/* expected,/*C*/ desired);boolatomic_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);boolatomic_flag_test_and_set(volatileatomic_flag* object);boolatomic_flag_test_and_set_explicit(volatileatomic_flag* object,memory_order order);voidatomic_flag_clear(volatileatomic_flag* object);voidatomic_flag_clear_explicit(volatileatomic_flag* object,memory_order order);
      Retrieved from "https://en.cppreference.com/mwiki/index.php?title=c/header/stdatomic&oldid=180140"

      [8]ページ先頭

      ©2009-2025 Movatter.jp