|
IntrOS
|
condition variables More...
Macros | |
| #define | cndOne ( false ) |
| notify one task | |
| #define | cndAll ( true ) |
| notify all tasks (broadcast) | |
| #define | OS_CND(cnd) |
| define and initialize a condition variable object | |
| #define | static_CND(cnd) |
| static alias of OS_CND() | |
| #define | CND_INIT() |
| create and initialize a condition variable object | |
| #define | CND_CREATE() |
| create and initialize a condition variable object | |
| #define | CND_NEW CND_CREATE |
| alias of CND_CREATE() | |
Functions | |
| void | cnd_init (cnd_t *cnd) |
| initialize a condition variable object | |
| void | cnd_reset (cnd_t *cnd) |
| reset the condition variable object and wake up all waiting tasks with 'E_STOPPED' event value | |
| void | cnd_kill (cnd_t *cnd) |
| alias of cnd_reset() | |
| int | cnd_waitFor (cnd_t *cnd, mtx_t *mtx, cnt_t delay) |
| wait for given duration of time on the condition variable releasing the currently owned mutex, and finally lock the mutex again | |
| int | cnd_waitUntil (cnd_t *cnd, mtx_t *mtx, cnt_t time) |
| wait until given timepoint on the condition variable releasing the currently owned mutex, and finally lock the mutex again | |
| int | cnd_wait (cnd_t *cnd, mtx_t *mtx) |
| wait indefinitely on the condition variable releasing the currently owned mutex, and finally lock the mutex again | |
| void | cnd_give (cnd_t *cnd, bool all) |
| signal one or all tasks that are waiting on the condition variable | |
| void | cnd_notifyOne (cnd_t *cnd) |
| signal one task waiting on the condition variable | |
| void | cnd_notifyAll (cnd_t *cnd) |
| signal all tasks waiting on the condition variable | |
condition variables
| #define OS_CND | ( | cnd | ) |
define and initialize a condition variable object
| cnd | name of a pointer to condition variable object |
| #define static_CND | ( | cnd | ) |
static alias of OS_CND()
| #define CND_INIT | ( | ) |
create and initialize a condition variable object
| #define CND_CREATE | ( | ) |
| void cnd_init | ( | cnd_t * | cnd | ) |
initialize a condition variable object
| cnd | pointer to condition variable object |
| void cnd_reset | ( | cnd_t * | cnd | ) |
reset the condition variable object and wake up all waiting tasks with 'E_STOPPED' event value
| cnd | pointer to condition variable object |
| int cnd_waitFor | ( | cnd_t * | cnd, |
| mtx_t * | mtx, | ||
| cnt_t | delay ) |
wait for given duration of time on the condition variable releasing the currently owned mutex, and finally lock the mutex again
| cnd | pointer to condition variable object |
| mtx | currently owned mutex |
| delay | duration of time (maximum number of ticks to wait on the condition variable object)
|
| E_SUCCESS | condition variable object was successfully signalled; owned mutex was locked again |
| E_FAILURE | mutex object can't be unlocked |
| E_STOPPED | condition variable or mutex object was reseted |
| E_TIMEOUT | condition variable object was not signalled before the specified timeout expired; owned mutex was locked again |
| int cnd_waitUntil | ( | cnd_t * | cnd, |
| mtx_t * | mtx, | ||
| cnt_t | time ) |
wait until given timepoint on the condition variable releasing the currently owned mutex, and finally lock the mutex again
| cnd | pointer to condition variable object |
| mtx | currently owned mutex |
| time | timepoint value |
| E_SUCCESS | condition variable object was successfully signalled; owned mutex was locked again |
| E_FAILURE | mutex object can't be unlocked |
| E_STOPPED | condition variable or mutex object was reseted |
| E_TIMEOUT | condition variable object was not signalled before the specified timeout expired; owned mutex was locked again |
|
inline |
wait indefinitely on the condition variable releasing the currently owned mutex, and finally lock the mutex again
| cnd | pointer to condition variable object |
| mtx | currently owned mutex |
| E_SUCCESS | condition variable object was successfully signalled; owned mutex was locked again |
| E_FAILURE | mutex object can't be unlocked |
| E_STOPPED | condition variable or mutex object was reseted |
| void cnd_give | ( | cnd_t * | cnd, |
| bool | all ) |
signal one or all tasks that are waiting on the condition variable
| cnd | pointer to condition variable object |
| all | signal receiver
|
|
inline |
signal one task waiting on the condition variable
| cnd | pointer to condition variable object |
|
inline |
signal all tasks waiting on the condition variable
| cnd | pointer to condition variable object |