23 #ifndef ETCPAL_CPP_MUTEX_H_
24 #define ETCPAL_CPP_MUTEX_H_
28 #include "etcpal/mutex.h"
99 bool TryLock(
int timeout_ms = 0);
210 inline void MutexGuard::GetLock()
213 ETCPAL_THROW(std::runtime_error(
"etcpal_mutex_lock failed."));
Lock guard around a mutex.
Definition: mutex.h:173
~MutexGuard()
Release the lock upon going out-of-scope.
Definition: mutex.h:205
MutexGuard(Mutex &mutex)
Lock an etcpal::Mutex.
Definition: mutex.h:192
A wrapper class for the EtcPal mutex type.
Definition: mutex.h:88
~Mutex()
Destroy the mutex.
Definition: mutex.h:115
Mutex()
Create a new mutex.
Definition: mutex.h:109
bool Lock()
Lock the mutex.
Definition: mutex.h:122
bool TryLock(int timeout_ms=0)
Attempt to lock the mutex.
Definition: mutex.h:138
void Unlock()
Unlock the mutex.
Definition: mutex.h:146
etcpal_mutex_t & get()
Get a reference to the underlying etcpal_mutex_t type.
Definition: mutex.h:152
Common definitions used by EtcPal C++ wrappers.
void etcpal_mutex_destroy(etcpal_mutex_t *id)
Destroy a mutex object.
PLATFORM_DEFINED etcpal_mutex_t
The mutex identifier.
Definition: mutex.dox:83
void etcpal_mutex_unlock(etcpal_mutex_t *id)
Unlock a mutex.
bool etcpal_mutex_create(etcpal_mutex_t *id)
Create a new mutex.
bool etcpal_mutex_timed_lock(etcpal_mutex_t *id, int timeout_ms)
Try to lock a mutex, giving up after a timeout.
bool etcpal_mutex_lock(etcpal_mutex_t *id)
Lock a mutex.