Infineon Logo AIROC BTSDK v4.2 - Documentation
 
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Groups Pages
Threads

Thread management functions. More...

Functions

wiced_thread_t * wiced_rtos_create_thread (void)
 Creates a new instance of thread. More...
 
wiced_bool_t wiced_rtos_check_for_stack_overflow (void)
 Checks if there is a stackoverflow. 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_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...
 

Detailed Description

Thread management functions.

Function Documentation

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

Returns
TRUE : stack overflow
FALSE : not stack overflow
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)

Returns
valid pointer : on success.
NULL : if an error occurred
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

Parameters
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
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
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

Parameters
thread: the handle of the other thread against which the current thread will be compared
Returns
WICED_SUCCESS : specified thread is the current thread
WICED_ERROR : specified thread is not currently running
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.

Parameters
thread: the handle of the other thread which will be woken
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred
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.

Parameters
thread: the handle of the other thread which will terminate
Returns
WICED_SUCCESS : on success.
WICED_ERROR : if an error occurred