TSK_exit
2-492
C Interface
Syntax
TSK_exit();
Parameters
Void
Return Value
Void
Description
TSK_exit terminates execution of the current task, changing its mode
from TSK_RUNNING to TSK_TERMINATED. If all tasks have been
terminated, or if all remaining tasks have their exitflag attribute set to
FALSE, then DSP/BIOS terminates the program as a whole by calling the
function SYS_exit with a status code of 0.
TSK_exit is automatically called whenever a task returns from its top-
level function.
You can use Tconf to specify an application-wide Exit function that runs
whenever a task is terminated. The default Exit function is a no-op
function. The Exit function is called before the task has been blocked and
marked TSK_TERMINATED. Any DSP/BIOS function can be called from
an Exit function. Calling TSK_self within an Exit function returns the task
being exited. Your Exit function declaration should be similar to the
following:
Void myExitFxn(Void);
A task switch occurs when calling TSK_exit unless the program as a
whole is terminated.
Constraints and
Calling Context
❏
TSK_exit cannot be called from a SWI or HWI.
❏
TSK_exit cannot be called from the program’s main() function.
See Also
MEM_free
TSK_create
TSK_delete
TSK_exit
Terminate execution of the current task