共用方式為


atomic_flag_test_and_set 函式

將bool中加上旗標 atomic_flag 物件到true,藉由套用memory_order_seq_cstmemory_order

inline bool atomic_flag_test_and_set(
   volatile atomic_flag *Flag,
) _NOEXCEPT;
inline bool atomic_flag_test_and_set(
   atomic_flag *Flag,
) _NOEXCEPT;

參數

  • Flag
    變數的指標, atomic_flag物件。

傳回值

Flag 的初始值。

需求

標頭: 不可部分完成

Namespace: 標準

請參閱

參考

<atomic>