mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-09-12 00:57:44 -04:00
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:
parent
464695a4f2
commit
a8a25d0062
1 changed files with 2 additions and 2 deletions
4
tasks.c
4
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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue