TNeoKernel  v1.03
 All Data Structures Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
Data Fields
TN_Task Struct Reference

Detailed Description

Task.

Definition at line 173 of file tn_tasks.h.

Data Fields

TN_UWordstack_top
 pointer to task's current top of the stack; Note that this field must be a first field in the struct, this fact is exploited by platform-specific routines. More...
 
struct TN_ListItem task_queue
 queue is used to include task in ready/wait lists
 
struct TN_Timer timer
 timer object to implement task waiting for timeout
 
struct TN_ListItem * pwait_queue
 pointer to object's (semaphore, mutex, event, etc) wait list in which task is included for waiting
 
struct TN_ListItem create_queue
 queue is used to include task in creation list (currently, this list is used for statistics only)
 
struct TN_ListItem mutex_queue
 list of all mutexes that are locked by task
 
struct TN_ListItem deadlock_list
 list of other tasks involved in deadlock. More...
 
TN_UWordbase_stack_top
 base top of the stack for this task
 
int stack_size
 size of task's stack (in sizeof(TN_UWord), not bytes)
 
TN_TaskBodytask_func_addr
 pointer to task's body function given to tn_task_create()
 
void * task_func_param
 pointer to task's parameter given to tn_task_create()
 
int base_priority
 base priority of the task (actual current priority may be higher than base priority because of mutex)
 
int priority
 current task priority
 
enum TN_ObjId id_task
 id for object validity verification
 
enum TN_TaskState task_state
 task state
 
enum TN_WaitReason task_wait_reason
 reason for waiting (relevant if only task_state is WAIT or WAIT+SUSPEND)
 
enum TN_RCode task_wait_rc
 waiting result code (reason why waiting finished)
 
int tslice_count
 time slice counter
 
union {
   struct TN_EGrpTaskWait   eventgrp
 fields specific to tn_eventgrp.h
 
   struct TN_DQueueTaskWait   dqueue
 fields specific to tn_dqueue.h
 
   struct TN_FMemTaskWait   fmem
 fields specific to tn_fmem.h
 
subsys_wait
 subsystem-specific fields that are used while task waits for something. More...
 
const char * name
 task name for debug purposes, user may want to set it by hand
 
unsigned priority_already_updated: 1
 Internal flag used to optimize mutex priority algorithms. More...
 
unsigned waited: 1
 Flag indicates that task waited for something This flag is set automatially in _tn_task_set_waiting() Must be cleared manually before calling any service that could sleep, if the caller is interested in the relevant value of this flag. More...
 

Field Documentation

TN_UWord* TN_Task::stack_top

pointer to task's current top of the stack; Note that this field must be a first field in the struct, this fact is exploited by platform-specific routines.

Definition at line 177 of file tn_tasks.h.

struct TN_ListItem TN_Task::deadlock_list

list of other tasks involved in deadlock.

This list is non-empty only in emergency cases, and it is here to help you fix your bug that led to deadlock.

See also
TN_MUTEX_DEADLOCK_DETECT

Definition at line 207 of file tn_tasks.h.

union { ... } TN_Task::subsys_wait

subsystem-specific fields that are used while task waits for something.

Do note that these fields are grouped by union, so, they must not interfere with each other. It's quite ok here because task can't wait for different things.

unsigned TN_Task::priority_already_updated

Internal flag used to optimize mutex priority algorithms.

For the comments on it, see file tn_mutex.c, function _mutex_do_unlock().

Definition at line 278 of file tn_tasks.h.

unsigned TN_Task::waited

Flag indicates that task waited for something This flag is set automatially in _tn_task_set_waiting() Must be cleared manually before calling any service that could sleep, if the caller is interested in the relevant value of this flag.

Definition at line 284 of file tn_tasks.h.


The documentation for this struct was generated from the following file: