The LockGuard class. This class provides RAII locks based on Mark3's kernel Mutex object. Note that Mark3 does not support exceptions, so care must be taken to ensure that this object is only used where that constraint can be met.
More...
#include <lockguard.h>
The LockGuard class. This class provides RAII locks based on Mark3's kernel Mutex object. Note that Mark3 does not support exceptions, so care must be taken to ensure that this object is only used where that constraint can be met.
Definition at line 32 of file lockguard.h.
◆ LockGuard() [1/2]
Mark3::LockGuard::LockGuard |
( |
Mutex * |
pclMutex | ) |
|
- Parameters
-
pclMutex | mutex to lock during construction |
Definition at line 25 of file lockguard.cpp.
◆ LockGuard() [2/2]
Mark3::LockGuard::LockGuard |
( |
Mutex * |
pclMutex, |
|
|
uint32_t |
u32TimeoutMs_ |
|
) |
| |
- Parameters
-
pclMutex | mutex to lock during construction |
u32TimeoutMs_ | timeout (in ms) to wait before bailng |
Definition at line 34 of file lockguard.cpp.
◆ ~LockGuard()
Mark3::LockGuard::~LockGuard |
( |
| ) |
|
◆ isAcquired()
bool Mark3::LockGuard::isAcquired |
( |
| ) |
|
|
inline |
Verify that lock was correctly initialized and locked during acquisition. This is used to provide error-checking for timed RAII locks, where Mark3 does not use exceptions, and a kernel-panic is too heavy-handed.
- Returns
- true if the lock was initialed correctly, false on error
Definition at line 54 of file lockguard.h.
◆ m_bIsAcquired
bool Mark3::LockGuard::m_bIsAcquired |
|
private |
◆ m_pclMutex
Mutex* Mark3::LockGuard::m_pclMutex |
|
private |
The documentation for this class was generated from the following files: