HTL_thread_cond_init
Initializes environment variables.
Interface Definition
int HTL_thread_cond_init(HTL_thread_cond_t *thread_cond, const HTL_thread_condattr_t *thread_condattr);
Description
HTL_thread_cond_init() initializes the condition variable based on the condition attribute thread_condattr and returns the condition handle through thread_cond.
The condition variable thread_cond needs to be destroyed by HTL_thread_cond_destroy() after being used.
This function allows only the condition variable attribute thread_condattr to be set to NULL.
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
thread_cond |
HTL_thread_cond_t * |
Address of the handle to the condition variable. |
Output |
thread_condattr |
HTL_thread_condattr_t * |
Address of the handle to the condition variable attribute. |
Input |
Return Value
- HTL_THREAD_SUCCESS: success.
- Other values: failure. For details, see the error code descriptions.
Example
1 2 | HTL_thread_cond_t cond = HTL_THREAD_COND_NULL; ret = HTL_thread_cond_init(&cond, NULL); |
Parent topic: Condition Variable Functions