首页
学习
活动
专区
工具
TVP
发布
精选内容/技术社群/优惠产品,尽在小程序
立即前往

ATOMIC_FLAG_INIT

Defined in header <atomic>

?

?

#define ATOMIC_FLAG_INIT /* implementation-defined */

?

?

定义可用于初始化的表达式。std::atomic_flag若要使用语句清除%28 false%29状态,请执行以下操作std::atomic_flagv = ATOMIC_FLAG_INIT;如果可以与其他初始化上下文一起使用,则未指定。

如果标志是静态的存储时间,这个初始化是静态的...

这是初始化std::atomic_flag值:在任何其他初始化后持有的值未指定。

二次

代码语言:javascript
复制
#include <atomic>
 
std::atomic_flag static_flag = ATOMIC_FLAG_INIT; // static initialization,
// guaranteed to be available during dynamic initialization of static objects.
 
int main()
{
    std::atomic_flag automatic_flag = ATOMIC_FLAG_INIT; // guaranteed to work
//    std::atomic_flag another_flag(ATOMIC_FLAG_INIT); // unspecified
}

二次

另见

atomic_flag (C++11)

the lock-free boolean atomic type (class)

代码语言:txt
复制
 ? cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

扫码关注腾讯云开发者

领取腾讯云代金券

http://www.vxiaotou.com