|
VLink 2.0.0
A high-performance communication middleware
|
RAII guard that acquires a SpinLock on construction and releases it on destruction.
More...
#include <spin_lock.h>
Public Member Functions | |
| SpinLockGuard (SpinLock &lock) noexcept | |
Acquires lock immediately. | |
| ~SpinLockGuard () noexcept | |
| Releases the lock held by this guard. | |
RAII guard that acquires a SpinLock on construction and releases it on destruction.
Analogous to std::lock_guard<SpinLock>. Preferred over manual lock() / unlock() because it is exception-safe.
|
inlineexplicitnoexcept |
Acquires lock immediately.
| lock | The SpinLock to acquire. Must outlive this guard. |
|
inlinenoexcept |
Releases the lock held by this guard.