13 return _lock.load(std::memory_order_acquire);
18 return !_lock.exchange(
true, std::memory_order_acquire);
52 while (_lock.exchange(
true, std::memory_order_acquire));
57 _lock.store(
false, std::memory_order_release);
High resolution timestamp.
void Unlock() noexcept
Release spin-lock.
bool TryLock() noexcept
Try to acquire spin-lock without block.
void Lock() noexcept
Acquire spin-lock with block.
bool TryLockSpin(int64_t spin) noexcept
Try to acquire spin-lock for the given spin count.
bool IsLocked() noexcept
Is already locked?
bool TryLockFor(const Timespan ×pan) noexcept
Try to acquire spin-lock for the given timespan.
C++ Common project definitions.