TSK_delete
Application Program Interface
2-487
C Interface
Syntax
TSK_delete(task);
Parameters
TSK_Handle task;
/* task object handle */
Return Value
Void
Description
TSK_delete removes the task from all internal queues and calls
MEM_free to free the task object and stack. task should be in a state that
does not violate any of the listed constraints.
If all remaining tasks have their exitflag attribute set to FALSE, DSP/BIOS
terminates the program as a whole by calling SYS_exit with a status code
of 0.
You can use Tconf to specify an application-wide Delete function that
runs whenever a task is deleted. The default Delete function is a no-op
function. The Delete function is called before the task object has been
removed from any internal queues and its object and stack are freed. Any
DSP/BIOS function can be called from the Delete function. DSP/BIOS
passes the task handle of the task being deleted to your Delete function.
Your Delete function declaration should be similar to the following:
Void myDeleteFxn(TSK_Handle task);
TSK_delete calls MEM_free to delete the TSK object. MEM_free must
acquire a lock to the memory before proceeding. If another task already
holds a lock to the memory, then there is a context switch.
Note:
Unless the mode of the deleted task is TSK_TERMINATED,
TSK_delete should be called with care. For example, if the task has
obtained exclusive access to a resource, deleting the task makes the
resource unavailable.
Constraints and
Calling Context
❏
The task cannot be the currently executing task (TSK_self).
❏
TSK_delete cannot be called from a SWI or HWI.
❏
No check is performed to prevent TSK_delete from being used on a
statically-created object. If a program attempts to delete a task object
that was created using Tconf, SYS_error is called.
See Also
TSK_delete
Delete a task