SuperTuxKart 1.5 upstream source (from official release tarball)
This commit is contained in:
@@ -0,0 +1,14 @@
|
||||
#ifndef HEADER_GE_SPIN_LOCK_HPP
|
||||
#define HEADER_GE_SPIN_LOCK_HPP
|
||||
|
||||
#include <atomic>
|
||||
class GESpinLock
|
||||
{
|
||||
mutable std::atomic_flag m_locked = ATOMIC_FLAG_INIT;
|
||||
public:
|
||||
void lock() const
|
||||
{ while (m_locked.test_and_set(std::memory_order_acquire)); }
|
||||
void unlock() const { m_locked.clear(std::memory_order_release); }
|
||||
};
|
||||
|
||||
#endif
|
||||
Reference in New Issue
Block a user