Namensräume
Varianten
Aktionen

ATOMIC_VAR_INIT

Aus cppreference.com
< c‎ | atomic

 
 
Atomare Operationen Bibliothek
Types
Original:
Types
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
memory_order
atomic_flag
Makros
Original:
Macros
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
ATOMIC_***_LOCK_FREE
ATOMIC_FLAG_INIT
ATOMIC_VAR_INIT
kill_dependency
Funktionen
Original:
Functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
atomic_flag_test_and_set
atomic_flag_clear
atomic_init
atomic_is_lock_free
atomic_store
atomic_load
atomic_exchange
atomic_compare_exchange
atomic_fetch_add
atomic_fetch_sub
atomic_fetch_or
atomic_fetch_xor
atomic_fetch_and
atomic_thread_fence
atomic_signal_fence
 
Defined in header <stdatomic.h>
#define ATOMIC_VAR_INIT(value) /* unspecified */
(Seit C11)
Ausdehnt, um einen Ausdruck, der verwendet wird, um eine atomare Variable des gleichen Typs wie value initialisiert werden kann. Der Anfangswert des atomaren Aufgabe automatischen Lagerdauer, der nicht initialisiert wird, dieses Makro undefiniert. Der Standardwert (null) Initialisierung von statischen und thread-lokale Variablen produziert gültigen Wert allerdings .
Original:
Expands to an expression that can be used to initialize an atomic variable of the same type as value. The initial value of atomic object of automatic storage duration that is not initialized using this macro is undefined. The default (zero) initialization of static and thread-local variables produces valid value however.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Wenn diese Makro nicht für die Initialisierung eines atomaren Variable verwendet, irgendwelche Zugriffe während der Initialisierung von einem anderen Thread, auch durch eine elementare Operation, ist ein Daten-Rennen (es kann passieren, wenn die Adresse sofort zu einem anderen Thread mit einer memory_order_relaxed Betrieb bestanden).
Original:
If this macro is not used for initialization of an atomic variable, any accesses during initialization from another thread, even through an atomic operation, is a data race (it may happen if the address is immediately passed to another thread with a memory_order_relaxed operation).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[Bearbeiten] Siehe auch

initialisiert eine neue atomic_flag
Original:
initializes a new atomic_flag
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(Makro konstant) [edit]