xiaoxiang781216 commented on a change in pull request #2946: URL: https://github.com/apache/incubator-nuttx/pull/2946#discussion_r585226542
########## File path: sched/task/task_exithook.c ########## @@ -645,7 +645,20 @@ void nxtask_exithook(FAR struct tcb_s *tcb, int status, bool nonblocking) if (!nonblocking) { + /* NOTE: nxtask_flushstreams() calls lib_flushall() + * which handles a semaphore in userspace. + * It should be done without a critical section. + */ + +#ifdef CONFIG_SMP + leave_critical_section(flags); +#endif + nxtask_flushstreams(tcb); Review comment: should we move after line 611? since: 1. It mayn't safe to exit the critical section temporarily at this point 2. It look safe to move the flush ahead since the code from line 611 to here is just for notification ---------------------------------------------------------------- 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: us...@infra.apache.org