sched: Don't call nxnotify_cancellation in task_setcancelstate

since it is impossible that the current running thread is
in the waiting state and then need to wake up self.

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
Change-Id: Ie2ba55c382eb3eb7c8d9f04bba1b9e294aaf6196
This commit is contained in:
Xiang Xiao 2020-06-07 00:41:47 +08:00 committed by Abdelatif Guettouche
parent 4a72bcc488
commit 2160a65030

View File

@ -114,18 +114,7 @@ int task_setcancelstate(int state, FAR int *oldstate)
#ifdef CONFIG_CANCELLATION_POINTS
/* If we are using deferred cancellation? */
if ((tcb->flags & TCB_FLAG_CANCEL_DEFERRED) != 0)
{
/* Yes.. If we are within a cancellation point, then
* notify of the cancellation.
*/
if (tcb->cpcount > 0)
{
nxnotify_cancellation(tcb);
}
}
else
if ((tcb->flags & TCB_FLAG_CANCEL_DEFERRED) == 0)
#endif
{
/* No.. We are using asynchronous cancellation. If the