HTL_thread_attr_getstack
Obtains the stack size in the specified memory from the thread attribute.
Interface Definition
int HTL_thread_attr_getstack(HTL_thread_attr_t *thread_attr, void **stackaddr, size_t *stacksize);
Description
HTL_thread_attr_getstack() obtains the stack address and stack size (in bytes) from thread_attr and returns them through stackaddr and stacksize.
Parameters
Parameter |
Type |
Description |
Input/Output |
|---|---|---|---|
thread_attr |
HTL_thread_attr_t * |
Address of the handle to the thread attribute. |
Input |
stackaddr |
void ** |
Stack address. |
Output |
stacksize |
size_t * |
Stack size, in bytes. |
Output |
Return Value
- HTL_THREAD_SUCCESS: success.
- Other values: failure. For details, see the error code descriptions.
Example
1 2 3 4 5 6 7 8 9 | HTL_thread_t self_thread; HTL_thread_attr_t self_thread_attr; ret = HTL_self_get_thread(&self_thread); ret = HTL_thread_get_attr(self_thread, &self_thread_attr); void *p_stack; size_t stacksize; ret = HTL_thread_attr_getstack(&self_thread_attr, &p_stack, &stacksize); ret = HTL_thread_attr_destroy(&self_thread_attr); |
Parent topic: Thread Attribute Functions