TNeo  BETA v1.08-11-g97e5a6d
Data Fields
TN_Task Struct Reference

Detailed Description

Task.

Definition at line 330 of file tn_tasks.h.

Data Fields

TN_UWordstack_cur_pt
 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...
 
enum TN_ObjId id_task
 id for object validity verification. 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_ListItempwait_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_UWordstack_low_addr
 – lowest address of stack. More...
 
TN_UWordstack_high_addr
 – Highest address of stack. More...
 
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_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.
 
struct _TN_TaskProfiler profiler
 Profiler data, available if only TN_PROFILER is non-zero.
 
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

◆ stack_cur_pt

TN_UWord* TN_Task::stack_cur_pt

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 334 of file tn_tasks.h.

◆ id_task

enum TN_ObjId TN_Task::id_task

id for object validity verification.

This field is in the beginning of the structure to make it easier to detect memory corruption. For struct TN_Task, we can't make it the very first field, since stack pointer should be there.

Definition at line 341 of file tn_tasks.h.

◆ deadlock_list

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 368 of file tn_tasks.h.

◆ stack_low_addr

TN_UWord* TN_Task::stack_low_addr

– lowest address of stack.

It is independent of architecture: it's always the lowest address (which may be actually origin or end of stack, depending on the architecture)

Definition at line 375 of file tn_tasks.h.

◆ stack_high_addr

TN_UWord* TN_Task::stack_high_addr

– Highest address of stack.

It is independent of architecture: it's always the highest address (which may be actually origin or end of stack, depending on the architecture)

Definition at line 379 of file tn_tasks.h.

◆ subsys_wait

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.

◆ priority_already_updated

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 441 of file tn_tasks.h.

◆ waited

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 447 of file tn_tasks.h.


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