Namespaces
Variants
Views
Actions

ATOMIC_FLAG_INIT

From cppreference.com
< cpp‎ | atomic
Revision as of 17:08, 2 November 2012 by P12bot (Talk | contribs)

 
 
 

Template:ddcl list begin <tr class="t-dsc-header">

<td>
Defined in header <atomic>
</td>

<td></td> <td></td> </tr> <tr class="t-dcl ">

<td class="t-dcl-nopad">
#define ATOMIC_FLAG_INIT /* implementation-defined */
</td>

<td class="t-dcl-nopad"> </td> <td class="t-dcl-nopad"> </td> </tr> Template:ddcl list end

Defines the expression which can be used to initialize std::atomic_flag to clear state. If the flag has static storage duration, this initialization is static.

Example

#include <atomic>
 
std::atomic_flag static_flag = ATOMIC_FLAG_INIT;
 
int main()
{
    std::atomic_flag automatic_flag = ATOMIC_FLAG_INIT;
    std::atomic_flag another_flag(ATOMIC_FLAG_INIT);
}

See also

Template:cpp/atomic/dcl list atomic flag