23 #ifndef ETCPAL_CPP_RECURSIVE_MUTEX_H_
24 #define ETCPAL_CPP_RECURSIVE_MUTEX_H_
28 #include "etcpal/recursive_mutex.h"
75 bool TryLock(
int timeout_ms = 0);
186 inline void RecursiveMutexGuard::GetLock()
189 ETCPAL_THROW(std::runtime_error(
"etcpal_recursive_mutex_lock failed."));
Lock guard around a recursive mutex.
Definition: recursive_mutex.h:149
~RecursiveMutexGuard()
Release the lock upon going out-of-scope.
Definition: recursive_mutex.h:181
RecursiveMutexGuard(RecursiveMutex &mutex)
Lock an etcpal::RecursiveMutex.
Definition: recursive_mutex.h:168
A wrapper class for the EtcPal recursive mutex type.
Definition: recursive_mutex.h:64
bool Lock()
Lock the mutex.
Definition: recursive_mutex.h:98
RecursiveMutex()
Create a new recursive mutex.
Definition: recursive_mutex.h:85
bool TryLock(int timeout_ms=0)
Attempt to lock the recursive mutex.
Definition: recursive_mutex.h:114
void Unlock()
Unlock the recursive mutex.
Definition: recursive_mutex.h:122
etcpal_recursive_mutex_t & get()
Get a reference to the underlying etcpal_recursive_mutex_t type.
Definition: recursive_mutex.h:128
~RecursiveMutex()
Destroy the recursive mutex.
Definition: recursive_mutex.h:91
Common definitions used by EtcPal C++ wrappers.
void etcpal_recursive_mutex_destroy(etcpal_recursive_mutex_t *id)
Destroy a mutex object.
bool etcpal_recursive_mutex_lock(etcpal_recursive_mutex_t *id)
Lock a mutex.
bool etcpal_recursive_mutex_create(etcpal_recursive_mutex_t *id)
Create a new mutex.
void etcpal_recursive_mutex_unlock(etcpal_recursive_mutex_t *id)
Unlock a mutex.
PLATFORM_DEFINED etcpal_recursive_mutex_t
The mutex identifier.
Definition: recursive_mutex.dox:51
bool etcpal_recursive_mutex_timed_lock(etcpal_recursive_mutex_t *id, int timeout_ms)
Try to lock a mutex, giving up after a timeout.