Code: Select all
// 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);
Code: Select all
// 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);