|
DSPark 1.8.0
Header-only C++20 DSP for real-time and offline audio
|
RAII wrapper that tries to acquire the lock without blocking. More...
#include <SpinLock.h>
Public Member Functions | |
| ScopedTryLock (SpinLock &spinLock) noexcept | |
| Constructs the guard and attempts a single lock acquisition. | |
| ~ScopedTryLock () noexcept | |
| Destructs the guard and releases the lock ONLY if it was successfully acquired. | |
| bool | isLocked () const noexcept |
| Queries whether the lock acquisition was successful. | |
| ScopedTryLock (const ScopedTryLock &)=delete | |
| ScopedTryLock & | operator= (const ScopedTryLock &)=delete |
RAII wrapper that tries to acquire the lock without blocking.
Check isLocked() before accessing the protected resource. Essential for reading shared data safely within the real-time audio thread.
Definition at line 168 of file SpinLock.h.
|
inlineexplicitnoexcept |
Constructs the guard and attempts a single lock acquisition.
| spinLock | The SpinLock to attempt to manage. |
Definition at line 175 of file SpinLock.h.
|
inlinenoexcept |
Destructs the guard and releases the lock ONLY if it was successfully acquired.
Definition at line 179 of file SpinLock.h.
|
delete |
|
inlinenoexcept |
Queries whether the lock acquisition was successful.
Definition at line 185 of file SpinLock.h.
|
delete |