c++ concurrency in action中的 SpinLockMutex
如下:class spinlock_mutex{ std::atomic_flag flag;public: spinlock_mutex() : flag(ATOMIC_FLAG_INIT) { } void lock() { while (flag.test_and_set(std::memory_order_acquire)); } void unlock...