Namespaces
Variants

std::atomic_flag:: test_and_set

From cppreference.net
Concurrency support library
Threads
(C++11)
(C++20)
this_thread namespace
(C++11)
(C++11)
Cooperative cancellation
Mutual exclusion
Generic lock management
Condition variables
(C++11)
Semaphores
Latches and Barriers
(C++20)
(C++20)
Futures
(C++11)
(C++11)
(C++11)
Safe reclamation
Hazard pointers
Atomic types
(C++11)
(C++20)
Initialization of atomic types
(C++11) (deprecated in C++20)
(C++11) (deprecated in C++20)
Memory ordering
(C++11) (deprecated in C++26)
Free functions for atomic operations
Free functions for atomic flags
定義先ヘッダ <atomic>
bool test_and_set ( std:: memory_order order =
std:: memory_order_seq_cst ) volatile noexcept ;
(1) (C++11以降)
bool test_and_set ( std:: memory_order order =
std:: memory_order_seq_cst ) noexcept ;
(2) (C++11以降)

std::atomic_flag の状態をアトミックに設定済み( true )に変更し、変更前の値を返します。

パラメータ

order - メモリ同期順序

関連項目

フラグをアトミックに false に設定する
(public member function)
フラグをアトミックに true に設定し、以前の値を返す
(function)
指定されたアトミック操作に対するメモリ順序制約を定義する
(enum)