Skip to content

Commit

Permalink
Rename taskTASK_YIELD to taskTASK_SCHEDULED_TO_YIELD
Browse files Browse the repository at this point in the history
  • Loading branch information
chinglee-iot committed Aug 31, 2023
1 parent 740b86b commit 4887bb4
Showing 1 changed file with 8 additions and 8 deletions.
16 changes: 8 additions & 8 deletions tasks.c
Original file line number Diff line number Diff line change
Expand Up @@ -260,10 +260,10 @@
#endif

/* Indicates that the task is not actively running on any core. */
#define taskTASK_NOT_RUNNING ( BaseType_t ) ( -1 )
#define taskTASK_NOT_RUNNING ( ( BaseType_t ) ( -1 ) )

/* Indicates that the task is actively running but scheduled to yield. */
#define taskTASK_YIELDING ( BaseType_t ) ( -2 )
#define taskTASK_SCHEDULED_TO_YILED ( ( BaseType_t ) ( -2 ) )

/* Returns pdTRUE if the task is actively running and not scheduled to yield. */
#if ( configNUMBER_OF_CORES == 1 )
Expand Down Expand Up @@ -700,7 +700,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
* so this is safe. */
pxThisTCB = pxCurrentTCBs[ portGET_CORE_ID() ];

while( pxThisTCB->xTaskRunState == taskTASK_YIELDING )
while( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YILED )
{
/* We are only here if we just entered a critical section
* or if we just suspended the scheduler, and another task
Expand All @@ -727,14 +727,14 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
portRELEASE_TASK_LOCK();

portMEMORY_BARRIER();
configASSERT( pxThisTCB->xTaskRunState == taskTASK_YIELDING );
configASSERT( pxThisTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YILED );

portENABLE_INTERRUPTS();

/* Enabling interrupts should cause this core to immediately
* service the pending interrupt and yield. If the run state is still
* yielding here then that is a problem. */
configASSERT( pxThisTCB->xTaskRunState != taskTASK_YIELDING );
configASSERT( pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YILED );

portDISABLE_INTERRUPTS();
portGET_TASK_LOCK();
Expand Down Expand Up @@ -763,7 +763,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
}
else
{
if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_YIELDING )
if( pxCurrentTCBs[ xCoreID ]->xTaskRunState != taskTASK_SCHEDULED_TO_YILED )
{
if( xCoreID == ( BaseType_t ) portGET_CORE_ID() )
{
Expand All @@ -772,7 +772,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
else
{
portYIELD_CORE( xCoreID );
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_YIELDING;
pxCurrentTCBs[ xCoreID ]->xTaskRunState = taskTASK_SCHEDULED_TO_YILED;
}
}
}
Expand Down Expand Up @@ -990,7 +990,7 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
}
else if( pxTCB == pxCurrentTCBs[ xCoreID ] )
{
configASSERT( ( pxTCB->xTaskRunState == xCoreID ) || ( pxTCB->xTaskRunState == taskTASK_YIELDING ) );
configASSERT( ( pxTCB->xTaskRunState == xCoreID ) || ( pxTCB->xTaskRunState == taskTASK_SCHEDULED_TO_YILED ) );

#if ( configUSE_CORE_AFFINITY == 1 )
if( ( pxTCB->uxCoreAffinityMask & ( ( UBaseType_t ) 1U << ( UBaseType_t ) xCoreID ) ) != 0U )
Expand Down

0 comments on commit 4887bb4

Please sign in to comment.