Semaphore definitions. More...
Semaphore definitions.
Definition in file sema.h.
 Include dependency graph for sema.h:
 Include dependency graph for sema.h: This graph shows which files directly or indirectly include this file:
 This graph shows which files directly or indirectly include this file:Go to the source code of this file.
| Data Structures | |
| struct | sema_t | 
| A Semaphore.  More... | |
| Macros | |
| #define | SEMA_CREATE(value) { (value), SEMA_OK, MUTEX_INIT } | 
| Creates semaphore statically.  More... | |
| #define | SEMA_CREATE_LOCKED() { (0), SEMA_OK, MUTEX_INIT_LOCKED } | 
| Creates semaphore statically initialized to 0.  More... | |
| Enumerations | |
| enum | sema_state_t { SEMA_OK = 0 , SEMA_DESTROY } | 
| A Semaphore states. | |
| Functions | |
| void | sema_create (sema_t *sema, unsigned int value) | 
| Creates semaphore dynamically.  More... | |
| void | sema_destroy (sema_t *sema) | 
| Destroys a semaphore.  More... | |
| static unsigned | sema_get_value (const sema_t *sema) | 
| Get a semaphore's current value.  More... | |
| int | _sema_wait_ztimer (sema_t *sema, int block, ztimer_clock_t *clock, uint32_t timeout) | 
| Wait for a semaphore, blocking or non-blocking.  More... | |
| static int | sema_wait (sema_t *sema) | 
| Wait for a semaphore being posted (without timeout).  More... | |
| static int | sema_try_wait (sema_t *sema) | 
| Test if the semaphore is posted.  More... | |
| static int | sema_wait_timed (sema_t *sema, uint64_t timeout) | 
| Wait for a semaphore being posted with a 64bit timeout.  More... | |
| static int | sema_wait_timed_ztimer (sema_t *sema, ztimer_clock_t *clock, uint32_t timeout) | 
| Wait for a semaphore being posted, using ztimer as backend.  More... | |
| int | sema_post (sema_t *sema) | 
| Signal semaphore.  More... | |