diff --git a/sched/irq/irq_csection.c b/sched/irq/irq_csection.c index fb23acab7b9..0ca55170a74 100644 --- a/sched/irq/irq_csection.c +++ b/sched/irq/irq_csection.c @@ -186,7 +186,7 @@ irqstate_t enter_critical_section(void) * lists are valid. */ - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); /* If called from an interrupt handler, then just take the spinlock. * If we are already in a critical section, this will lock the CPU @@ -335,7 +335,7 @@ try_again: * lists are valid. */ - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); DEBUGASSERT(!up_interrupt_context()); /* Normal tasking environment. @@ -424,7 +424,7 @@ irqstate_t enter_critical_section(void) * lists are valid. */ - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); /* Check if we were called from an interrupt handler */ @@ -451,7 +451,7 @@ inline_function irqstate_t enter_critical_section_nonirq(void) * lists are valid. */ - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); DEBUGASSERT(!up_interrupt_context()); rtcb = this_task(); @@ -546,7 +546,7 @@ inline_function void leave_critical_section_nonirq(irqstate_t flags) FAR struct tcb_s *rtcb; int cpu; - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); DEBUGASSERT(!up_interrupt_context()); /* Get the TCB of the currently executing task on this CPU (avoid @@ -620,7 +620,7 @@ inline_function void leave_critical_section_nonirq(irqstate_t flags) { FAR struct tcb_s *rtcb = this_task(); - DEBUGASSERT(g_nx_initstate >= OSINIT_TASKLISTS); + DEBUGASSERT(OSINIT_TASK_READY()); DEBUGASSERT(!up_interrupt_context()); DEBUGASSERT(rtcb != NULL);