322
K
A
DAK
AMX 86 Procedures
ajtkill ajtkill
Purpose Kill a Task
This procedure will force a ready, executing or suspended task to end. All
messages in the task's mailboxes at the time of the kill request will be
flushed. All requests for task execution pending at the time of the kill
request will be erased.
Used by n Task n IS P n Timer Procedure o Restart Procedure n Exit Procedure
Setup AMXID taskid;
int status;
.
.
status = ajtkill(taskid);
AX DX
Where taskid is the task id of the task to be killed.
Results Interrupts are disabled and then restored to their state at the time of the
call.
Status is returned.
AEROK = Call successful
AERNST = Invalid task id
AERANA = Task termination is not allowed
The task has not yet given its permission to be killed by
calling ajtktrm to specify a Task Termination Procedure.
Any task which is waiting for the task being killed to acknowledge receipt
of its message sent via ajsenw will be allowed to resume execution.
A task can kill itself.
Restriction You must not kill a task which is waiting, or is about to wait, for a
resource or counting semaphore, events in an event group or a message on
a message exchange. Failure to observe this restriction may lead to
unexpected and unpredictable faults.
See Also ajtkstp, ajtkdel, ajtktrm