![]() |
SuperTinyKernel™ RTOS 1.06.x
Lightweight, high-performance, deterministic, bare-metal C++ RTOS for resource-constrained embedded systems. MIT Open Source License.
|
RAII wrapper for attempting exclusive write access with a timeout. More...
#include <stk_sync_rwmutex.h>
Public Member Functions | |
| ScopedTimedLock (RWMutex &rw, Timeout timeout_ticks=WAIT_INFINITE) | |
| Constructs the guard and attempts to acquire the write lock. | |
| ~ScopedTimedLock () | |
| bool | IsLocked () const |
Private Member Functions | |
| ScopedTimedLock (const ScopedTimedLock &)=delete | |
| ScopedTimedLock & | operator= (const ScopedTimedLock &)=delete |
Private Attributes | |
| RWMutex & | m_rw |
| bool | m_locked |
RAII wrapper for attempting exclusive write access with a timeout.
Definition at line 85 of file stk_sync_rwmutex.h.
|
inlineexplicit |
Constructs the guard and attempts to acquire the write lock.
| [in] | rw | Reference to the RWMutex. |
| [in] | timeout_ticks | Maximum time to wait (ticks). Use NO_WAIT for non-blocking (TryLock). |
Definition at line 92 of file stk_sync_rwmutex.h.
References m_locked, m_rw, stk::sync::RWMutex::RWMutex(), stk::sync::RWMutex::TimedLock(), and stk::WAIT_INFINITE.
Referenced by operator=().
|
inline |
|
privatedelete |
|
inline |
|
privatedelete |
|
private |
Definition at line 104 of file stk_sync_rwmutex.h.
Referenced by IsLocked(), ScopedTimedLock(), and ~ScopedTimedLock().
|
private |
Definition at line 103 of file stk_sync_rwmutex.h.
Referenced by ScopedTimedLock(), and ~ScopedTimedLock().