Contains condition variable (CV) function prototypes.
More...
◆ osa_cond_create()
Create and return a new condition variable object
- Parameters
-
cond | A condition object that will be allocated and initialized. It is returned to the call on success. |
- Return values
-
ERRCODE_NO_ERROR | Function succeeded |
ERRCODE_OUT_OF_MEMORY | Out of memory |
ERRCODE_BUSY | Attempting to reinitialize an existing CV |
ERRCODE_GENERAL_ERROR | Unexpected system error |
◆ osa_cond_destroy()
Free the resources for a condition variable object
- Parameters
-
cond | A valid condition object |
- Return values
-
ERRCODE_NO_ERROR | Function succeeded |
ERRCODE_BUSY | Attempting to reinitialize an existing CV |
ERRCODE_GENERAL_ERROR | Unexpected system error |
◆ osa_cond_wait()
int osa_cond_wait |
( |
OsaCondition * |
cond, |
|
|
OsaMutex * |
mutex, |
|
|
uint32_t |
msec_timeout |
|
) |
| |
Release the mutex and wait on the condition argument. The mutex is reacquired before the function returns.
- Parameters
-
cond | A valid condition object |
mutex | A valid mutex object that the caller holds a lock on |
msec_timeout | Optional timeout. If zero, the wait will block forever. Any other value will cause the wait to abort after the specified number of milliseconds. |
- Return values
-
ERRCODE_NO_ERROR | Function succeeded |
ERRCODE_OUT_OF_MEMORY | Out of memory |
ERRCODE_INVALID_ARGUMENT | Invalid condition parameter |
ERRCODE_PERMISSION_DENIED | Mutex not owned by the calling thread |
ERRCODE_GENERAL_ERROR | Unexpected system error |
◆ osa_cond_signal()
Unblock one thread waiting for the condition argument
- Parameters
-
cond | A valid condition object |
- Return values
-
ERRCODE_NO_ERROR | Function succeeded |
ERRCODE_OUT_OF_MEMORY | Out of memory |
ERRCODE_INVALID_ARGUMENT | Invalid condition parameter |
ERRCODE_GENERAL_ERROR | Unexpected system error |
◆ osa_cond_broadcast()
Unblock all threads waiting for the condition argument
- Parameters
-
cond | A valid condition object |
- Warning
- On MQX this does the same as osa_cond_signal
- Return values
-
ERRCODE_NO_ERROR | Function succeeded |
ERRCODE_OUT_OF_MEMORY | Out of memory |
ERRCODE_INVALID_ARGUMENT | Invalid condition parameter |
ERRCODE_GENERAL_ERROR | Unexpected system error |