|
VLink
2.0.0
A high-performance communication middleware
|
RAII wrapper that locks a SpinLock on construction and unlocks on destruction.
更多...
#include <spin_lock.h>
Public 成员函数 | |
| SpinLockGuard (SpinLock &lock) noexcept | |
Acquires lock immediately. 更多... | |
| ~SpinLockGuard () noexcept | |
| Releases the held spin lock. 更多... | |
RAII wrapper that locks a SpinLock on construction and unlocks on destruction.
Equivalent to std::lock_guard<SpinLock>. Preferred over manual lock / unlock because it is exception-safe.
|
inlineexplicitnoexcept |
Acquires lock immediately.
| lock | Spin lock to acquire. Must outlive this guard. |
|
inlinenoexcept |
Releases the held spin lock.