|
ion 0.12.0
Atomic concurrency support library
|
Busy spinning lock that satisfies BasicLockable, Lockable and Mutex requirements. More...
#include <ion/spinLock.hpp>
Public Member Functions | |
| SpinLock (SpinLock const &)=delete | |
| void | lock () noexcept |
| Acquires the lock. | |
| ION_FORCE_INLINE bool | try_lock () noexcept |
| Attempts to acquire the lock. | |
| void | unlock () noexcept |
| Releases held lock. | |
Busy spinning lock that satisfies BasicLockable, Lockable and Mutex requirements.
Implementation busy-spins without sleeping or yielding, does not detect resource deadlocks and does not throw any exceptions.
Can be used with e.g. std::lock_guard, std::scoped_lock and std::unique_lock.
|
inlinenoexcept |
Acquires the lock.
|
inlinenoexcept |
Attempts to acquire the lock.
|
inlinenoexcept |
Releases held lock.