diff --git a/tasks.c b/tasks.c index d63f6ccfd..cd0ce5d91 100644 --- a/tasks.c +++ b/tasks.c @@ -4291,10 +4291,10 @@ static void prvResetNextTaskUnblockTime( void ) void vTaskEnterCritical( void ) { - portDISABLE_INTERRUPTS(); - if( xSchedulerRunning != pdFALSE ) { + portDISABLE_INTERRUPTS(); + ( pxCurrentTCB->uxCriticalNesting )++; /* This is not the interrupt safe version of the enter critical