会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
muzzik
博客园
首页
新随笔
联系
订阅
管理
2020年2月12日
C++原子操作(atomic)使用
摘要: 小白记录贴 std::atomic<bool> a(true); //定义一个类型为atomic_bool的原子变量并赋初值为true原子操作:赋值: a = true;a.store(true); 读取:int b = a;int b = a.load(); 原子操作还可以包含一个参数:内存顺序(
阅读全文
posted @ 2020-02-12 12:07 Muzzik
阅读(6489)
评论(0)
推荐(2)
公告