From 62940d3d56391826960876afd04ace7e535a86d1 Mon Sep 17 00:00:00 2001 From: "Ching-Hsin,Lee" Date: Wed, 19 Jun 2024 15:07:08 +0800 Subject: [PATCH] Remove run state assertion in prvCheckForRunStateChange The task run state can still be altered after it enable the interrupt to serviec the yield request. --- tasks.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/tasks.c b/tasks.c index f8740257c..7a65e7ba5 100644 --- a/tasks.c +++ b/tasks.c @@ -845,10 +845,11 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION; 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_SCHEDULED_TO_YIELD ); + /* Enabling interrupts should cause this core to immediately service + * the pending interrupt and yield. After servicing the pending interrupt, + * the task needs to re-evaluate its run state within this loop, as + * other cores may have requested this task to yield, potentially altering + * its run state. */ portDISABLE_INTERRUPTS(); portGET_TASK_LOCK();