Skip to main content

Structures

ar_osal_thread_attr_t

Thread attributes. Members
char_t *
Pointer to the thread name.
uint32_t
Size of the thread stack.
int32_t
Thread priority.

Functions

ar_osal_thread_attr_init

Thread attribute initialization API, client allocates the memory for ar_osal_thread. @datatypes osal_thread_attribute_t
Parameters
ar_osal_thread_attr_t *
Initialize thread object.
Returns 0 Success Nonzero Failure

ar_osal_thread_create

Creates and launches a thread. @datatypes ar_osal_thread_t
Parameters
ar_osal_thread_t *
Pointer to the thread.
Pointer to the thread attributes.
ar_osal_thread_start_routine
Pointer to the entry function of the thread.
void *
Pointer to the arguments passed to the entry function. An argument can be to any pointer type. @detdesc The thread stack can be passed in as the osal_thread_stack argument, or osal_thread_stack=NULL indicates that osal allocates the stack internally. If the caller provides the stack, the caller is responsible for freeing the stack memory after joining the thread.
Returns 0 Success Nonzero Failure.

ar_osal_thread_get_id

Get current thread id.
Parameters
thread id: Current thread id.
Returns Thread id.

ar_osal_thread_join_destroy

Waits for a specified thread to exit, and collects the exit status and clear the thread object. @datatypes ar_osal_thread_t
Parameters
ar_osal_thread_t
Thread to wait on.
Returns 0 Success. Nonzero Failure.

ar_osal_thread_get_priority

Queries the thread priority using a thread handle. @dependencies Before calling this function, the object must be created and initialized. @newpage
Parameters
ar_osal_thread_t
Thread handle.
int32_t *
current thread priority

ar_osal_thread_set_priority

Changes the thread priority using a thread handle.
Parameters
ar_osal_thread_t
Thread handle.
int32_t
New thread priority to set
Returns 0 Success. Nonzero Failure.

ar_osal_thread_self_get_priority

Queries the thread priority within the thread work function.
Parameters
int32_t *
get thread priority
Returns 0 Success. Nonzero Failure.

ar_osal_thread_self_set_priority

Changes the thread priority within the thread work function.
Parameters
int32_t
New priority to set
Returns 0 Success. Nonzero Failure.

Type Definitions

ar_osal_thread_t

Handle to a thread.

ar_osal_thread_attr_t

Thread attributes.

ar_osal_thread_start_routine

osal thread start function definition.