mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-06-03 19:09:04 -04:00
Remove run state assertion in prvCheckForRunStateChange (#1093)
In `prvCheckForRunStateChange()`, enabling interrupts should cause this core to immediately service the pending interrupt and yield. Upon the next scheduling of the task, the assertion `configASSERT(pxThisTCB->xTaskRunState != taskTASK_SCHEDULED_TO_YIELD);` may not be true, as other cores could have requested a yield for this task before it evaluates its run state within the assertion. To address this, the task re-evaluates its run state in critical section within a loop until it is eligible for execution, which is the current implementation. Consequently, this assertion should be removed to ensure correct behavior.
This commit is contained in:
parent
76eb443821
commit
0c79e74eaa
9
tasks.c
9
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();
|
||||
|
|
Loading…
Reference in a new issue