sched: Make task_delete(getpid()) equal exit(EXIT_SUCCESS)
Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com> Change-Id: I63b2a372ccf0e9ac4e6a7fc9b1b160d71eeeb40f
This commit is contained in:
parent
fd5fc2ab07
commit
f70981c179
@ -132,6 +132,17 @@ int task_delete(pid_t pid)
|
|||||||
goto errout;
|
goto errout;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Check if the task to delete is the calling task */
|
||||||
|
|
||||||
|
if (pid == rtcb->pid)
|
||||||
|
{
|
||||||
|
/* If it is, then what we really wanted to do was exit. Note that we
|
||||||
|
* don't bother to unlock the TCB since it will be going away.
|
||||||
|
*/
|
||||||
|
|
||||||
|
exit(EXIT_SUCCESS);
|
||||||
|
}
|
||||||
|
|
||||||
/* Check to see if this task has the non-cancelable bit set in its
|
/* Check to see if this task has the non-cancelable bit set in its
|
||||||
* flags. Suppress context changes for a bit so that the flags are stable.
|
* flags. Suppress context changes for a bit so that the flags are stable.
|
||||||
* (the flags should not change in interrupt handling).
|
* (the flags should not change in interrupt handling).
|
||||||
@ -183,17 +194,7 @@ int task_delete(pid_t pid)
|
|||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
|
|
||||||
/* Check if the task to delete is the calling task */
|
|
||||||
|
|
||||||
sched_unlock();
|
sched_unlock();
|
||||||
if (pid == rtcb->pid)
|
|
||||||
{
|
|
||||||
/* If it is, then what we really wanted to do was exit. Note that we
|
|
||||||
* don't bother to unlock the TCB since it will be going away.
|
|
||||||
*/
|
|
||||||
|
|
||||||
exit(EXIT_SUCCESS);
|
|
||||||
}
|
|
||||||
|
|
||||||
/* Otherwise, perform the asynchronous cancellation, letting
|
/* Otherwise, perform the asynchronous cancellation, letting
|
||||||
* nxtask_terminate() do all of the heavy lifting.
|
* nxtask_terminate() do all of the heavy lifting.
|
||||||
|
Loading…
Reference in New Issue
Block a user