ATOMIC_VAR_INIT
Aus cppreference.com
|
|
This page has been machine-translated from the English version of the wiki using Google Translate.
The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
<metanoindex/>
<tbody> </tbody>| definiert 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.
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.
You can help to correct and verify the translation. Click here for instructions.
Siehe auch
(C11) |
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) |