typedef struct { unsigned *stack_pointer; unsigned *thread_local_storage; unsigned *stack_start; unsigned char priority; unsigned char state; unsigned char timeout_occured; CTL_TASK_s *next; CTL_TIME_t timeout; void *wait_object; CTL_EVENT_SET_t wait_events; void *data; CTL_TIME_t execution_time; const char *name; } CTL_TASK_t;
CTL_TASK_t defines the task structure. The task structure contains:
Member | Description |
stack_pointer | the saved register state of the task when it is not scheduled |
thread_local_storage | pointer to the thread local storage of this task |
priority | the priority of the task |
state | the state of task CTL_STATE_RUNNABLE or (CTL_STATE_*_WAIT_* | CTL_STATE_TIMER_WAIT) or CTL_STATE_SUSPENDED |
timeout_occured | 1 if a wait timed out otherwise 0 - when state is CTL_RUNNABLE |
next | next pointer for wait queue |
timeout | wait timeout value or time slice value when the task is executing |
wait_object | the event set, semaphore, message queue or mutex to wait on |
wait_events | the events to wait for |
data | task specific data pointer |
execution_time | number of ticks the task has executed for |
stack_start | the start (lowest address) of the stack |
name | task name |