![]() |
Pothos
0.6.0-g9da168ef
The Pothos dataflow programming software suite
|
#include <SpinLock.hpp>
Public Member Functions | |
| SpinLock (void) | |
| Create a new unlocked spin lock. More... | |
| bool | try_lock (void) noexcept |
| Try to lock, return true for lock. More... | |
| void | lock (void) noexcept |
| Lock the spin lock, block if already locked. More... | |
| void | unlock (void) noexcept |
| Unlock the spin lock (should be already locked) More... | |
A generic spin lock implementation using std::atomic.
There are no embedded back-off or sleep conditions in this lock, therefore only use this lock to protect very brief code sections.
This lock can be used with std::lock_guard<Pothos::Util::SpinLock>
|
inline |
Create a new unlocked spin lock.
|
inlinenoexcept |
Lock the spin lock, block if already locked.
|
inlinenoexcept |
Try to lock, return true for lock.
|
inlinenoexcept |
Unlock the spin lock (should be already locked)
1.8.13