AIROC™ BTSDK v4.9 - Documentation | ||||
Thread management functions. More...
Functions | |
wiced_thread_t * | wiced_rtos_create_thread (void) |
Creates a new instance of thread. More... | |
wiced_result_t | wiced_rtos_init_thread (wiced_thread_t *thread, uint8_t priority, const char *name, wiced_thread_function_t function, uint32_t stack_size, void *arg) |
Initializes and starts a new thread. More... | |
wiced_bool_t | wiced_rtos_check_for_stack_overflow (void) |
Checks if there is a stackoverflow. More... | |
uint32_t | wiced_rtos_thread_stack_size (wiced_thread_t *thread) |
Return the thread stack size. More... | |
uint32_t | wiced_bt_rtos_max_stack_use (wiced_thread_t *thread) |
Returns maximum stack usage of the thread. More... | |
wiced_result_t | wiced_rtos_delay_milliseconds (uint32_t milliseconds, wiced_delay_type_t delay_type) |
Sleep for a given period of milliseconds. More... | |
wiced_result_t | wiced_rtos_delay_microseconds (uint32_t microseconds) |
Delay for a given period of microseconds. More... | |
wiced_result_t | wiced_rtos_thread_join (wiced_thread_t *thread) |
Sleeps until another thread has terminated. More... | |
wiced_result_t | wiced_rtos_thread_force_awake (wiced_thread_t *thread) |
Forcibly wakes another thread. More... | |
wiced_result_t | wiced_rtos_is_current_thread (wiced_thread_t *thread) |
Checks if a thread is the current thread. More... | |
Thread management functions.
uint32_t wiced_bt_rtos_max_stack_use | ( | wiced_thread_t * | thread | ) |
Returns maximum stack usage of the thread.
Returns maximum stack usage size if thread signature is valid, else returns 0
[in] | thread | : point to the thread context Note: thread is a return value from wiced_rtos_create_thread() |
wiced_bool_t wiced_rtos_check_for_stack_overflow | ( | void | ) |
Checks if there is a stackoverflow.
Verifies if the stack of the thread from which this API is invoked is corrupted
wiced_thread_t* wiced_rtos_create_thread | ( | void | ) |
Creates a new instance of thread.
Creates a new thread (Allocates memory for a new thread instance and returns the pointer)
wiced_result_t wiced_rtos_delay_microseconds | ( | uint32_t | microseconds | ) |
Delay for a given period of microseconds.
Causes the current thread to block for AT LEAST the specified number of microseconds. If the processor is heavily loaded with higher priority tasks, the delay may be much longer than requested.
NOTE: All threads with equal or lower priority than the current thread will not be able to run while the delay is occurring.
microseconds | : the time to delay in microseconds |
wiced_result_t wiced_rtos_delay_milliseconds | ( | uint32_t | milliseconds, |
wiced_delay_type_t | delay_type | ||
) |
Sleep for a given period of milliseconds.
Causes the current thread to sleep for AT LEAST the specified number of milliseconds. If the processor is heavily loaded with higher priority tasks, the delay may be much longer than requested.
milliseconds | : the time to sleep in milliseconds |
delay_type | : delay type to be used during the duration of the delay. Use the delay type as ALLOW_THREAD_TO_SLEEP to allow the current running thread to sleep or as KEEP_THREAD_ACTIVE to keep the current running thread active |
wiced_result_t wiced_rtos_init_thread | ( | wiced_thread_t * | thread, |
uint8_t | priority, | ||
const char * | name, | ||
wiced_thread_function_t | function, | ||
uint32_t | stack_size, | ||
void * | arg | ||
) |
Initializes and starts a new thread.
Initializes and starts a new thread
thread | : Pointer to variable that will receive the thread handle |
priority | : A priority number or WICED_DEFAULT_APP_THREAD_PRIORITY. |
name | : a text name for the thread (can be null) |
function | : the main thread function |
stack_size | : stack size for this thread |
arg | : argument which will be passed to thread function |
wiced_result_t wiced_rtos_is_current_thread | ( | wiced_thread_t * | thread | ) |
Checks if a thread is the current thread.
Checks if a specified thread is the currently running thread
thread | : the handle of the other thread against which the current thread will be compared |
wiced_result_t wiced_rtos_thread_force_awake | ( | wiced_thread_t * | thread | ) |
Forcibly wakes another thread.
Causes the specified thread to wake from suspension. This will usually cause an error or timeout in that thread, since the task it was waiting on is not complete.
thread | : the handle of the other thread which will be woken |
wiced_result_t wiced_rtos_thread_join | ( | wiced_thread_t * | thread | ) |
Sleeps until another thread has terminated.
Causes the current thread to sleep until the specified other thread has terminated. If the processor is heavily loaded with higher priority tasks, this thread may not wake until significantly after the thread termination.
thread | : the handle of the other thread which will terminate |
uint32_t wiced_rtos_thread_stack_size | ( | wiced_thread_t * | thread | ) |
Return the thread stack size.
Returns stack size if thread signature is valid, else returns 0