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
ctl_message_queue_receive_nb | Receive a message from a message queue without blocking
Byte queue functions
ctl_byte_queue_init | Initialise a byte queue
ctl_byte_queue_post | Post a byte to a byte queue or timeout
ctl_byte_queue_post_nb | Post a byte to a byte queue without blocking
ctl_byte_queue_receive | Receive a byte from a byte queue or timeout
ctl_byte_queue_receive_nb | Receive a message from a byte queue without blocking
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_start_timer | Start the timer ticking.
ctl_current_time | The current time in ticks.
ctl_get_current_time | Return the number of ticks in a second.
ctl_get_current_time | Atomically return the current time in ticks.
ctl_increment_tick_from_isr | Increment tick timer.
ctl_timeout_wait | Wait until timeout has occured.
ctl_timeslice_period | The timeslice period - zero means no time slicing.
Programmable interrupt controller support
ctl_set_isr | Install an interrupt service routine
ctl_mask_isr | Mask an interrupt source
ctl_unmask_isr | Unmask an interrupt source
Low level interrupt service routine support
ctl_exit_isr | Exit from ISR and check for reschedule
ctl_interrupt_count | Nested interrupt count
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