34 bool try_lock(
void) noexcept;
37 void lock(
void) noexcept;
40 void unlock(
void) noexcept;
43 std::atomic_flag _lock;
56 return not _lock.test_and_set(std::memory_order_acquire);
61 while (not this->try_lock()){}
66 _lock.clear(std::memory_order_release);
#define POTHOS_API
Definition: Config.hpp:41
Definition: SpinLock.hpp:26
bool try_lock(void) noexcept
Try to lock, return true for lock.
Definition: SpinLock.hpp:54
void unlock(void) noexcept
Unlock the spin lock (should be already locked)
Definition: SpinLock.hpp:64
Definition: ArchiveEntry.hpp:20
void lock(void) noexcept
Lock the spin lock, block if already locked.
Definition: SpinLock.hpp:59
SpinLock(void)
Create a new unlocked spin lock.
Definition: SpinLock.hpp:49