23 std::atomic_flag
flag = ATOMIC_FLAG_INIT;
29 for(
unsigned i = 0;
flag.test_and_set(std::memory_order_acquire); ++i)
30 if(i & 1) std::this_thread::yield();
35 flag.clear(std::memory_order_release);
Intended for locking of resources that are only lightly contended and locked for very short times,...