Skip to content

Commit

Permalink
fix(freertos-smp): Prevent call to prvCheckForRunStateChange before s…
Browse files Browse the repository at this point in the history
…cheduler is running

This commit updates the kernel data group locks to not call
prvCheckForRunStatechange() before the scheduler has started running.
  • Loading branch information
sudeep-mohanty committed Sep 24, 2024
1 parent ea82219 commit 01bcde1
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -558,7 +558,7 @@ PRIVILEGED_DATA static volatile configRUN_TIME_COUNTER_TYPE ulTotalRunTime[ conf
#define taskLOCK_KERNEL_DATA_GROUP() \
portDISABLE_INTERRUPTS(); \
portGET_SPINLOCK( &xTaskSpinlock ); \
if( portGET_CRITICAL_NESTING_COUNT() == 0U ) \
if( ( xSchedulerRunning != pdFALSE ) && ( portGET_CRITICAL_NESTING_COUNT() == 0U ) ) \
{ \
prvCheckForRunStateChange(); \
} \
Expand Down Expand Up @@ -879,7 +879,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
* so this is safe. */
pxThisTCB = pxCurrentTCBs[ portGET_CORE_ID() ];

while( pxThisTCB && ( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD ) )
while( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YIELD )
{
#if ( portUSING_GRANULAR_LOCKS == 1 )
{
Expand Down

0 comments on commit 01bcde1

Please sign in to comment.