xiaoxiang781216 commented on a change in pull request #1187:
URL: https://github.com/apache/incubator-nuttx/pull/1187#discussion_r437876538
##########
File path: sched/pthread/pthread_cancel.c
##########
@@ -85,6 +76,15 @@ int pthread_cancel(pthread_t thread)
pthread_exit(PTHREAD_CANCELED);
}
Review comment:
The behaviour is same as before, the change is just an optimizition. If
you look at nxnotify_cancellation, the main job is call
nxsem_wait_irq/nxsig_wait_irq/nxmq_wait_irq but the code unnecessary if some
thread call pthread_cancel on self because the thread is impossible in the wait
state.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]