xiaoxiang781216 commented on code in PR #20540:
URL: https://github.com/apache/nuttx/pull/20540#discussion_r4227079690
##########
sched/wqueue/kwork_queue.c:
##########
@@ -144,15 +144,14 @@ static int work_qqueue(FAR struct kwork_wqueue_s *wqueue,
work_timer_reset(wqueue);
}
- spin_unlock_irqrestore(&wqueue->lock, flags);
-
if (delay == 0)
{
- /* Immediately wake up the worker thread. */
+ /* Post while the queue lock keeps the semaphore alive. */
nxsem_post(&wqueue->sem);
}
+ spin_unlock_irqrestore(&wqueue->lock, flags);
Review Comment:
but nxsem_post may wake up the high-priority thread and make this line can't
reach.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]