7 #ifndef __MERCURY_COROUTINE_ENGINE_ATOMIC__
8 #define __MERCURY_COROUTINE_ENGINE_ATOMIC__
28 while(lock_.test_and_set(std::memory_order_acquire)){ }
31 inline bool try_lock()
33 return !(lock_.test_and_set(std::memory_order_acquire));
38 lock_.clear(std::memory_order_release);
42 std::atomic_flag lock_;
Core mechanism for atomic synchronization.
Definition: atomic.hpp:20