名前空間
変種
操作

std::once_flag

提供: cppreference.com
< cpp‎ | thread

Defined in header <mutex>
class once_flag;
(C++11およびそれ以降)

The class std::once_flag is a helper structure for std::call_once.

An object of type std::once_flag that is passed to multiple calls to std::call_once allows those calls to coordinate with eachother such that only one of the calls will actually run to completion.

std::once_flag is noncopyable.

目次

[編集] メンバ関数

std::once_flag::once_flag

once_flag();

Constructs an once_flag object. The internal state is set to indicate that no function has been called yet.

Parameters

(none)

Exceptions

noexcept specification:  
noexcept
  (C++11およびそれ以降)

[編集] も参照してください

(C++11)
この関数は、複数のスレッドから呼び出される場合であっても一度だけ呼び出します
Original:
invokes a function only once even if called from multiple threads
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(関数テンプレート) [edit]