Provides binary semaphore support for task synchronization.
◆ mmosal_semb_create()
| struct mmosal_semb * mmosal_semb_create |
( |
const char * |
name | ) |
|
Create a new binary semaphore.
- Parameters
-
| name | The name of the semaphore. |
- Returns
- an opaque handle to the semaphore, or
NULL on failure.
◆ mmosal_semb_delete()
| void mmosal_semb_delete |
( |
struct mmosal_semb * |
semb | ) |
|
Delete the given binary semaphore.
- Parameters
-
◆ mmosal_semb_give()
| bool mmosal_semb_give |
( |
struct mmosal_semb * |
semb | ) |
|
Give a binary semaphore.
- Warning
- May not be invoked from an ISR.
- Parameters
-
| semb | The semaphore to give. |
- Returns
true on success, else false.
◆ mmosal_semb_give_from_isr()
| bool mmosal_semb_give_from_isr |
( |
struct mmosal_semb * |
semb | ) |
|
Give a binary semaphore (from ISR context).
- Warning
- May only be invoked from an ISR.
- Parameters
-
| semb | The semaphore to give. |
- Returns
true on success, else false.
◆ mmosal_semb_wait()
| bool mmosal_semb_wait |
( |
struct mmosal_semb * |
semb, |
|
|
uint32_t |
timeout_ms |
|
) |
| |
Wait for a counting semaphore.
- Parameters
-
| semb | The semaphore to wait for. |
| timeout_ms | Timeout after which to give up waiting (in milliseconds). |
- Returns
true if the the semaphore was taken successfully, else false.