|
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
Defined in header <mutex> | ||
class once_flag; | (since C++11) | |
The classstd::once_flag is a helper structure forstd::call_once.
An object of typestd::once_flag that is passed to multiple calls tostd::call_once allows those calls to coordinate with each other such that only one of the calls will actually run to completion.
std::once_flag is neither copyable nor movable.
Contents |
constexpr once_flag()noexcept; | ||
Constructs anonce_flag object. The internal state is set to indicate that no function has been called yet.
(none)
(C++11) | invokes a function only once even if called from multiple threads (function template)[edit] |
C documentation foronce_flag | |