The header file <ctl_api.h> defines functions and macros that you can use to write multi-threaded applications. For more information on how to use the tasking library, please see the Tasking Library Tutorial.

Task management functions
ctl_task_die Terminate the executing task
ctl_task_executing Active task
ctl_task_init Create initial task
ctl_task_list Priority-ordered list of runnable tasks
ctl_task_run Create a task
ctl_task_remove Remove a task from waiting task list
ctl_task_reschedule Cause a reschedule
ctl_task_set_priority Set the priority of a task
Event Set functions
ctl_events_init Initialise an event set
ctl_events_set_clear Set and clear events
ctl_events_wait Wait for events or timeout
Semaphore functions
ctl_semaphore_init Initialise a semaphore
ctl_semaphore_signal Signal a semaphore
ctl_semaphore_wait Wait for a semaphore or timeout
Message queue functions
ctl_message_queue_init Initialise a message queue
ctl_message_queue_post Post a message to a message queue or timeout
ctl_message_queue_post_nb Post a message to a message queue without blocking
ctl_message_queue_receive Receive a message from a message queue or timeout
Global interrupts control
ctl_global_interrupts_disable Disable global interrupts
ctl_global_interrupts_enable Enable global interrupts
ctl_global_interrupts_set Set global interrupts to saved state
ctl_global_interrupts_re_enable_from_isr Reenable global interrupts from an interrupt service routine
ctl_global_interrupts_un_re_enable_from_isr Redisable global interrupts from an interrupt service routine
Timer support
ctl_current_time The current time in ticks
ctl_get_current_time Return the current time in ticks
ctl_increment_tick_from_isr Increment tick timer
ctl_timeout_wait Wait until timeout has occured
Memory areas
ctl_memory_area_init Initialise a memory area
ctl_memory_area_allocate Allocate a block from a memory area
ctl_memory_area_free Return a block to a memory area
Miscellaneous functions and variables
ctl_handle_error Handle an error condition
ctl_libc_mutex C library mutex