Рассмотрим этот пример:
#include
#include
#include
#include
int main(){
std::atomic v = 0;
std::thread t1([&](){
if(v.exchange(1,std::memory_order::acq_rel) == 2){ // #1
std::cout
Подробнее здесь: https://stackoverflow.com/questions/792 ... edes-the-e
Мобильная версия