std::atomic_flag_test_and_set

From Cppreference

Jump to: navigation, search
Defined in header <atomic>

bool atomic_flag_test_and_set( volatile std::atomic_flag* p );
(1) (C++11 feature)
bool atomic_flag_test_and_set( std::atomic_flag* p );
(2) (C++11 feature)
bool atomic_flag_test_and_set_explicit( volatile std::atomic_flag* p,
                                        std::memory_order order );
(3) (C++11 feature)
bool atomic_flag_test_and_set_explicit( std::atomic_flag* p,
                                        std::memory_order order );
(4) (C++11 feature)

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

Contents

[edit] Parameters

p - pointer to std::atomic_flag to access
order - the memory sycnhronization ordering for this operation

[edit] Exceptions

noexcept specification:  
noexcept

  (C++11 feature)

[edit] Equivalent definition

[edit] See also

atomic_flag (C++11)
the lock-free boolean atomic type
(class)
atomic_flag_clear
atomic_flag_clear_explicit
(C++11)
(C++11)
atomically sets the value of the flag to false
(function)
memory_order (C++11)
defines memory ordering constraints for the given atomic operation
(typedef)