Task Support
2-7
Operating System Abstraction API
Destroy a Task Thread
TaskDestroy
Syntax
void TaskDestroy( HANDLE hTask );
Parameter(s)
hTask
Handle to target task
Return Value
nothing
Description
Terminates execution of the task object specified by the supplied handle
hTask, and frees task object from system memory. Note that memory allocated
by the task thread is not associated with the task thread and must be freed
manually by the programmer.
Exit a Task Thread
TaskExit
Syntax
void TaskExit();
Parameter(s)
none
Return Value
Does not return
Description
This function is used to gracefully exit a task thread. It should always be called
immediately before the task entry-point function is about to return, but it may
be called from anywhere.
Get Task Environment Handle
TaskGetEnv
Syntax
HANDLE TaskGetEnv( HANDLE hTask, int Slot );
Parameter(s)
hTask
Handle to target task
Slot
Environment slot to use (1–3)
Return Value
Private environment handle or NULL
Description
NOTE: This function is currently not available under DSP/BIOS
Returns a private environment handle for the supplied task handle hTask
which was previously stored with the TaskSetEnv() function. The slot specified
in Slot specifies the address (1–3) of the environment handle. There are actu-
ally four slots, but slot 0 is reserved.
Get Task Priority
TaskGetPri
Syntax
int TaskGetPri( HANDLE hTask );
Parameter(s)
hTask
Handle to target task
Return Value
Task priority level
Description
Returns the priority of the target task. See TaskSetPri() for more information
on priority.