Provides mutex support for mutual exclusion.
◆ MMOSAL_MUTEX_GET_INF
| #define MMOSAL_MUTEX_GET_INF |
( |
|
_mutex | ) |
|
Value: do { \
MMOSAL_ASSERT(ok__); \
} while (0)
bool mmosal_mutex_get(struct mmosal_mutex *mutex, uint32_t timeout_ms)
Acquire a mutex.
Attempt to get a mutex, waiting infinitely long for it.
Panics on failure.
Definition at line 354 of file mmosal.h.
◆ MMOSAL_MUTEX_RELEASE
| #define MMOSAL_MUTEX_RELEASE |
( |
|
_mutex | ) |
|
Value: do { \
MMOSAL_ASSERT(ok__); \
} while (0)
bool mmosal_mutex_release(struct mmosal_mutex *mutex)
Release a mutex.
Same as mmosal_mutex_release() except it panics on failure.
Definition at line 363 of file mmosal.h.
◆ mmosal_mutex_create()
| struct mmosal_mutex * mmosal_mutex_create |
( |
const char * |
name | ) |
|
Create a new mutex.
- Parameters
-
| name | The name for the mutex. |
- Returns
- an opaque handle to the mutex, or
NULL on failure.
Definition at line 50 of file mmosal_shim_bootloader.c.
◆ mmosal_mutex_delete()
| void mmosal_mutex_delete |
( |
struct mmosal_mutex * |
mutex | ) |
|
◆ mmosal_mutex_get()
| bool mmosal_mutex_get |
( |
struct mmosal_mutex * |
mutex, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Acquire a mutex.
- Parameters
-
| mutex | Handle of mutex to acquire. |
| timeout_ms | Timeout after which to give up. To wait infinitely use UINT32_MAX. |
- Returns
true if the mutex was acquired successfully otherwise false.
Definition at line 61 of file mmosal_shim_bootloader.c.
◆ mmosal_mutex_is_held_by_active_task()
| bool mmosal_mutex_is_held_by_active_task |
( |
struct mmosal_mutex * |
mutex | ) |
|
Check whether the given mutex is held by the active thread.
- Parameters
-
| mutex | Handle of the mutex to check. |
- Returns
true if the mutex is held by the active thread, else false.
◆ mmosal_mutex_release()
| bool mmosal_mutex_release |
( |
struct mmosal_mutex * |
mutex | ) |
|
Release a mutex.
- Parameters
-
| mutex | Handle of mutex to release. |
- Returns
true if the mutex was released successfully otherwise false.
Definition at line 68 of file mmosal_shim_bootloader.c.