9 #ifndef CPPCOMMON_THREADS_SPIN_LOCK_H
10 #define CPPCOMMON_THREADS_SPIN_LOCK_H
96 std::atomic<
bool> _lock;
103 #include "spin_lock.inl"
Spin-lock synchronization primitive.
SpinLock & operator=(SpinLock &&)=delete
void Unlock() noexcept
Release spin-lock.
bool TryLockUntil(const UtcTimestamp ×tamp) noexcept
Try to acquire spin-lock until the given timestamp.
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?
SpinLock(const SpinLock &)=delete
SpinLock & operator=(const SpinLock &)=delete
SpinLock(SpinLock &&)=delete
bool TryLockFor(const Timespan ×pan) noexcept
Try to acquire spin-lock for the given timespan.
Locker synchronization primitive definition.
C++ Common project definitions.