名前空間
変種
操作

std::atomic_flag::test_and_set

提供: cppreference.com
< cpp‎ | atomic‎ | atomic flag
 
 
 
 
ヘッダ <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に設定します
(パブリックメンバ関数) [edit]
アトミックにフラグを true に設定し、その以前の値を返します
(関数) [edit]
指定されたアトミック操作のメモリ順序制約を定義します
(列挙) [edit]