如何使用atomic_store在多线程中将shared_ptr设置为 nullptr
作者:QIhao Wu 提问时间:11/2/2023
在 std::shared_ptr 线程安全中,这样的代码不是线程安全的: //In thread 1 shared_ptr<myClass> private = global; ... //In...
多线程原子 问答列表
作者:QIhao Wu 提问时间:11/2/2023
在 std::shared_ptr 线程安全中,这样的代码不是线程安全的: //In thread 1 shared_ptr<myClass> private = global; ... //In...
作者:Nieta 提问时间:11/12/2023
这是我上一个问题的后续问题 我有两个线程,我希望使用原子进行同步,并且使用最宽松的内存顺序...... //class members std::atomic_bool blocked = tru...