Namespaces
Variants
Views
Actions

std::atomic_flag::test_and_set

From cppreference.com
< cpp‎ | atomic‎ | atomic flag
Revision as of 17:19, 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 class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
bool test_and_set(std::memory_order order = std::memory_order_seq_cst) volatile;
</td>

<td > (1) </td> <td > (since C++11) </td> </tr> <tr class="t-dcl-sep"><td></td><td></td><td></td></tr>

<tr class="t-dcl ">

<td >
bool test_and_set(std::memory_order order = std::memory_order_seq_cst);
</td>

<td > (2) </td> <td > (since C++11) </td> </tr> Template:ddcl list end

Atomically changes the state of a std::atomic_flag to set (true) and returns the value it held before.

Parameters

order - the memory sycnhronization ordering for this operation

Exceptions

noexcept specification:  
noexcept
  

See also

Template:cpp/atomic/atomic flag/dcl list clearTemplate:cpp/atomic/dcl list atomic flag test and setTemplate:cpp/atomic/dcl list memory order