HTL_thread_get_attr
Obtains the thread attribute.
Interface Definition
int HTL_thread_get_attr(HTL_thread_t thread, HTL_thread_attr_t *thread_attr);
Description
HTL_thread_get_attr() returns a newly created thread attribute object that copies the thread attribute from the thread handle thread through thread_attr. The value of thread_attr may be different from the attribute value used when the thread is created. This function allocates thread attribute objects. Therefore, users need to invoke HTL_thread_attr_destroy() to release thread_attr after using this function.
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
thread |
HTL_thread_t |
Handle to the thread. |
Input |
attr |
HTL_thread_attr_t * |
Address to the thread attribute. |
Output |
Return Value
- HTL_THREAD_SUCCESS: success.
- Other values: failure. For details, see the error code descriptions.
Example
1 2 3 4 5 | HTL_thread_t thread; HTL_thread_attr_t attr; int ret; thread = HTL_thread_self(); ret = HTL_thread_get_attr(thread, &attr); |
Parent topic: Thread Attribute Functions