Everything

ext_tsk

Outline
Terminate invoking task.
C format
 void    ext_tsk (void);
Parameter(s)
None.
Explanation
This service call moves the invoking task from the RUNNING state to the DORMANT state.
As a result, the invoking task is unlinked from the ready queue and excluded from the RI600PX scheduling subject.
At this time, the following processing is done.
Table 19-4 Processing Performed at Task Termination
No.
Content of processing
1
Unlocks the mutexes which are locked by the terminated task. (processing equivalent to unl_mtx will be executed)

The CPU locked state and dispatching disabled state is cancelled.
If an activation request has been queued to the invoking task (the activation request counter > 0) when this service call is issued, this service call moves the task from the RUNNING state to the DORMANT state, decrements the activation request counter (by subtracting 1 from the activation request counter), and then moves the task from the DORMANT state to the READY state. At this time, processing described in Table 19-3 is done.
This service call does not return. In the following cases, this service call causes SYSTEM DOWN.
- This service call was issued from non-task.
- This service call was issued in the status PSW.IPL > kernel interrupt mask level
Note 1 When the return instruction is issued in the task entry function, the same processing as ext_tsk is performed.
Note 2 This service call does not have the function to automatically free the resources except the mutex hitherto occupied by the task (e.g., semaphores and memory blocks). Make sure the task frees these resources before it terminates
Return value
None.