c++ is assignment to std::atomic variable garanteed to be atomic?

后端 未结 0 2000
无人及你
无人及你 2021-02-06 10:35

I have the following scenario

// first assigned a value greater than 0
std::atomic var=1;

//thread 1
while (True) {
    var = 1;
}

//thread 2
if(v         


        
相关标签:
回答
  • 消灭零回复
提交回复
热议问题