std::once_flag

来自cppreference.com
< cpp‎ | thread

定义于头文件 <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规定:  
noexcept
  (C++11 起)

[编辑] 。另请参阅。

(C++11)
即使从多个线程调用,也只调用函数一次
原文:
invokes a function only once even if called from multiple threads
这段文字是通过 Google Translate 自动翻译生成的。
您可以帮助我们检查、纠正翻译中的错误。详情请点击这里

(函数模板) [编辑]