13 namespace ParallelUtils
47 while (m_Lock.test_and_set(std::memory_order_acquire)) {}
55 m_Lock.clear(std::memory_order_release);
59 std::atomic_flag m_Lock;
void unlock()
End a thread-safe region.
SpinLock(const SpinLock &)
Copy constructor, must be implemented as an empty function because the member variable of type std::a...
void lock()
Start a thread-safe region, where only one thread can execute at a time until a call to the unlock fu...
SpinLock()
Default constructor, initializes the atomic_flag member to memory_order_release state.