Код: Выделить всё
// thread A
while(!is_finished.test(memory_order_relaxed)) {
// supposing I have some observable side effects here
}
// thread B
is_finished.test_and_set(memory_order_relaxed);
Подробнее здесь: https://stackoverflow.com/questions/794 ... inite-loop
Мобильная версия