mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-13 16:27:43 -04:00
fix(freertos-smp): Fix yielding decisions based on preemption state of task
This commit is contained in:
parent
60bca5e8b2
commit
e3d92dd5fd
1 changed files with 25 additions and 8 deletions
33
tasks.c
33
tasks.c
|
@ -1085,12 +1085,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
|||
#endif
|
||||
{
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
{
|
||||
if( pxCurrentTCBs[ xCoreID ]->uxPreemptionDisable == 0U )
|
||||
#endif
|
||||
{
|
||||
xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
|
||||
xLowestPriorityCore = xCoreID;
|
||||
}
|
||||
else
|
||||
{
|
||||
xYieldPendings[ xCoreID ] = pdTRUE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
|
||||
xLowestPriorityCore = xCoreID;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -1391,12 +1402,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
|||
( xYieldPendings[ uxCore ] == pdFALSE ) )
|
||||
{
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
{
|
||||
if( pxCurrentTCBs[ uxCore ]->uxPreemptionDisable == 0U )
|
||||
#endif
|
||||
{
|
||||
xLowestPriority = xTaskPriority;
|
||||
xLowestPriorityCore = ( BaseType_t ) uxCore;
|
||||
}
|
||||
else
|
||||
{
|
||||
xYieldPendings[ uxCore ] = pdTRUE;
|
||||
}
|
||||
}
|
||||
#else
|
||||
{
|
||||
xLowestPriority = xTaskPriority;
|
||||
xLowestPriorityCore = ( BaseType_t ) uxCore;
|
||||
}
|
||||
#endif
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@ -3053,12 +3075,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
|||
/* Setting the priority of a running task down means
|
||||
* there may now be another task of higher priority that
|
||||
* is ready to execute. */
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
if( pxTCB->uxPreemptionDisable == 0U )
|
||||
#endif
|
||||
{
|
||||
xYieldRequired = pdTRUE;
|
||||
}
|
||||
xYieldRequired = pdTRUE;
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue