std::once_flag
来自cppreference.com
该页由英文版wiki使用Google Translate机器翻译而来。
该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. |
在头文件 <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
[编辑] 。另请参阅。
(C++11) |
只有一次,即使从多个线程调用调用一个函数 原文: invokes a function only once even if called from multiple threads (函数模板) |