anchao commented on code in PR #12281:
URL: https://github.com/apache/nuttx/pull/12281#discussion_r1591678383
##########
sched/irq/irq_csection.c:
##########
@@ -192,208 +192,207 @@ irqstate_t enter_critical_section(void)
* lists are valid.
*/
- if (nxsched_get_initstate() >= OSINIT_TASKLISTS)
+ DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
Review Comment:
It is better to move DEBUG check into `up_interrupt_context()` block, which
keeps `enter/leave_critical_section()` still callable during the initialization
phase to avoid unnecessary assertions
##########
sched/irq/irq_csection.c:
##########
@@ -463,104 +466,103 @@ void leave_critical_section(irqstate_t flags)
* lists are valid.
*/
- if (nxsched_get_initstate() >= OSINIT_TASKLISTS)
+ DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS);
Review Comment:
ditto
--
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]