|
oveRTOS C++ API
C++20 RAII wrappers for the oveRTOS C API
|
Scoped RAII guard that locks a Mutex on construction and unlocks it on destruction.
More...
#include <sync.hpp>
Public Member Functions | |
| LockGuard (Mutex &mtx) | |
| Constructs the guard, immediately locking the given mutex. | |
| ~LockGuard () | |
| Destroys the guard, unlocking the associated mutex. | |
| LockGuard (const LockGuard &)=delete | |
| LockGuard & | operator= (const LockGuard &)=delete |
| LockGuard (LockGuard &&)=delete | |
| LockGuard & | operator= (LockGuard &&)=delete |
Scoped RAII guard that locks a Mutex on construction and unlocks it on destruction.
This is the oveRTOS equivalent of std::lock_guard. The mutex is acquired with an indefinite timeout; a failure to acquire is treated as a fatal error via OVE_STATIC_INIT_ASSERT.
|
inlineexplicit |
Constructs the guard, immediately locking the given mutex.
| [in] | mtx | The mutex to lock. Must outlive this guard. |