|
| | SpinLock () |
| | Creates an unlocked lock. More...
|
| |
| void | lock () |
| | Blocks until a lock can be obtained for the current execution agent. More...
|
| |
| bool | try_lock () |
| | Attempts to acquire the lock for the current execution agent without blocking. More...
|
| |
| void | unlock () noexcept |
| | Releases the lock held by the execution agent. Throws no exceptions. More...
|
| |
Simple spin lock implemented by using an atomic. Note that function naming allows this to be used as a Lockable type (http://en.cppreference.com/w/cpp/concept/Lockable).
◆ SpinLock()
| catapult::utils::SpinLock::SpinLock |
( |
| ) |
|
|
inline |
Creates an unlocked lock.
◆ lock()
| void catapult::utils::SpinLock::lock |
( |
| ) |
|
|
inline |
Blocks until a lock can be obtained for the current execution agent.
◆ try_lock()
| bool catapult::utils::SpinLock::try_lock |
( |
| ) |
|
|
inline |
Attempts to acquire the lock for the current execution agent without blocking.
◆ unlock()
| void catapult::utils::SpinLock::unlock |
( |
| ) |
|
|
inlinenoexcept |
Releases the lock held by the execution agent. Throws no exceptions.
◆ m_isLocked
| std::atomic_flag catapult::utils::SpinLock::m_isLocked |
|
private |
The documentation for this class was generated from the following file: