get_task_info

Returns information about a task, including such items as priority, exception handler, containing job, and execution state.

See also:rq_get_task_accounting and rq_get_task_state for other information

Syntax, PL/M and C

CALL rq_get_task_info (target_task, info_ptr, except_ptr);

rq_get_task_info (target_task, info_ptr, except_ptr);

Parameter PL/M Data Type C Data Type
target_task SELECTOR SELECTOR
info_ptr POINTER TASK_INFO_STRUCT far *
except_ptr POINTER to WORD_16 UINT_16 *

Parameters

target_task
The token for the task for which to return information.

info_ptr
A pointer to the following structure declared by the application, where the call returns information.

DECLARE task_info_struct STRUCTURE (
owner_jobSELECTOR,
next_taskSELECTOR,
exception_handlerPOINTER,
exception_modeBYTE,
fill0BYTE,
static_priorityBYTE,
dynamic_priorityBYTE,
task_flagsBYTE,
interrupt_taskBYTE,
pending_interruptsBYTE,
max_interruptsBYTE,
int_levelWORD_16,
task_stateBYTE,
suspend_depthBYTE,
delay_requestWORD_16,
last_exchangeSELECTOR);

or

typedef struct {
SELECTORowner_job;
SELECTORnext_task;
void far *exception_handler;
UINT_8exception_mode;
UINT_8fill0;
UINT_8static_priority;
UINT_8dynamic_priority;
UINT_8task_flags;
UINT_8interrupt_task;
UINT_8pending_interrupts;
UINT_8max_interrupts;
UINT_16int_level;
UINT_8task_state;
UINT_8suspend_depth;
UINT_16delay_request;
SELECTORlast_exchange;
} TASK_INFO_STRUCT;

Where:

owner_jobToken for the job containing the target task.

next_taskNext task on the system task list, which allows easy scanning of all the tasks in the system.

exception_handler
Pointer to the task’s current exception handler. For flat model applications only, treat this parameter as two separate fields in the structure. The first field has the name listed above and is a near pointer. The second field has the same name with _seg appended at the end. It is a segment selector for the pointer.

fill1Reserved

static_priority
The task’s assigned priority when it was created.

dynamic_priority
The task’s current priority, which can be dynamically raised by accessing a region.

task_flags
The task flags specified when the task was created.

interrupt_task
If non-zero, the task is an interrupt task and the next three fields are valid. If 0, the task is not an interrupt task; ignore the next three fields.

pending_interrupts
Number of interrupts currently pending at the interrupt level associated with this interrupt task.

max_interrupts
Maximum number of interrupts that can be pending at the interrupt level associated with this interrupt task.

int_level
Interrupt level associated with this interrupt task.

task_state
One of the following indicates the task’s current state:

Value Meaning
0H Ready and running
1H Ready and not running
2H Asleep
3H Waiting at an exchange object
4H Waiting at a region
5H Waiting at an object directory
6H Waiting at a port
7H Being deleted
10H Suspended
12H Asleep/Suspended
13H Waiting at an exchange and Suspended
14H Waiting at a region and Suspended
15H Waiting at an object directory and Suspended
16H Waiting at a port and Suspended
17H Being deleted and Suspended
0FFH Task state unknown

suspend_depth
Suspension depth of the task, which is non-zero only if the task has been overtly suspended (as opposed to being suspended by the OS).

delay_request
Amount of time the task has been waiting at an exchange. This field is zero if the task has been waiting at any other type of object.

last_exchange
The token for an exchange object (e.g., mailbox or semaphore) at which the task is waiting. This field is zero if the task is not waiting at an exchange.

except_ptr
A pointer to a variable declared by the application where the call returns a condition code.

Condition Codes

E_OK 0000H No exceptional conditions occurred.