tasks.c: disable interrupts in critical section only if scheduler is started

Behaviour of `vTaskEnterCritical` and `vTaskExitCritical` was asymmetrical,
in the sense, if these APIs were invoked prior to scheduler start condition
then one would disable interrupts but other would not re-enable again.
This commit ensure that behaviour is symmetrical for pre-scheduler start
condition.
This commit is contained in:
Mahavir Jain 2020-03-28 17:26:21 +05:30
parent 464695a4f2
commit a8a25d0062

View file

@ -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