Why can atomics not be used to protect a critical section?

后端 未结 0 1412
独厮守ぢ
独厮守ぢ 2020-12-30 06:34
int main() {
    std::vector foo;
    std::atomic bar{0};
    std::mutex mx;
    auto job = [&] {
        for (size_t i = 0; i<1000000;          


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