jlaitine commented on code in PR #16673: URL: https://github.com/apache/nuttx/pull/16673#discussion_r2231589316
########## sched/sched/sched_unlock.c: ########## @@ -81,18 +89,28 @@ void sched_unlock(void) sched_note_preemption(rtcb, false); /* Release any ready-to-run tasks that have collected in - * g_pendingtasks. + * g_pendingtasks (or in g_readytorun for SMP) * * NOTE: This operation has a very high likelihood of causing * this task to be switched out! */ - if (list_pendingtasks()->head != NULL) +#ifdef CONFIG_SMP + /* If this task is the lowest priority task running across all + * CPUs, there may be some higher priority task pending because + * of the sched lock. + */ + + ptcb = (FAR struct tcb_s *)dq_peek(list_readytorun()); + if (ptcb && nxsched_select_cpu(ALL_CPUS) == rtcb->cpu && + ptcb->sched_priority > rtcb->sched_priority && + nxsched_deliver_task(rtcb->cpu, rtcb->cpu)) +#else + ptcb = (FAR struct tcb_s *)dq_peek(list_pendingtasks()); + if (ptcb && nxsched_merge_pending()) Review Comment: I'll just remove it then! -- 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: commits-unsubscr...@nuttx.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org