This is an automated email from the ASF dual-hosted git repository.

aguettouche pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 2160a6503021f6a71d4bc8764385c2f5a40db4fd
Author: Xiang Xiao <xiaoxi...@xiaomi.com>
AuthorDate: Sun Jun 7 00:41:47 2020 +0800

    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 <xiaoxi...@xiaomi.com>
    Change-Id: Ie2ba55c382eb3eb7c8d9f04bba1b9e294aaf6196
---
 sched/task/task_setcancelstate.c | 13 +------------
 1 file changed, 1 insertion(+), 12 deletions(-)

diff --git a/sched/task/task_setcancelstate.c b/sched/task/task_setcancelstate.c
index 5c12969..070253d 100644
--- a/sched/task/task_setcancelstate.c
+++ b/sched/task/task_setcancelstate.c
@@ -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

Reply via email to