mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-14 00:37:44 -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
31
tasks.c
31
tasks.c
|
@ -1085,12 +1085,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
||||||
#endif
|
#endif
|
||||||
{
|
{
|
||||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||||
|
{
|
||||||
if( pxCurrentTCBs[ xCoreID ]->uxPreemptionDisable == 0U )
|
if( pxCurrentTCBs[ xCoreID ]->uxPreemptionDisable == 0U )
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
|
xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
|
||||||
xLowestPriorityCore = xCoreID;
|
xLowestPriorityCore = xCoreID;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xYieldPendings[ xCoreID ] = pdTRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
xLowestPriorityToPreempt = xCurrentCoreTaskPriority;
|
||||||
|
xLowestPriorityCore = xCoreID;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
@ -1391,12 +1402,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
|
||||||
( xYieldPendings[ uxCore ] == pdFALSE ) )
|
( xYieldPendings[ uxCore ] == pdFALSE ) )
|
||||||
{
|
{
|
||||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||||
|
{
|
||||||
if( pxCurrentTCBs[ uxCore ]->uxPreemptionDisable == 0U )
|
if( pxCurrentTCBs[ uxCore ]->uxPreemptionDisable == 0U )
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
xLowestPriority = xTaskPriority;
|
xLowestPriority = xTaskPriority;
|
||||||
xLowestPriorityCore = ( BaseType_t ) uxCore;
|
xLowestPriorityCore = ( BaseType_t ) uxCore;
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
xYieldPendings[ uxCore ] = pdTRUE;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
#else
|
||||||
|
{
|
||||||
|
xLowestPriority = xTaskPriority;
|
||||||
|
xLowestPriorityCore = ( BaseType_t ) uxCore;
|
||||||
|
}
|
||||||
|
#endif
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -3053,13 +3075,8 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
|
||||||
/* Setting the priority of a running task down means
|
/* Setting the priority of a running task down means
|
||||||
* there may now be another task of higher priority that
|
* there may now be another task of higher priority that
|
||||||
* is ready to execute. */
|
* is ready to execute. */
|
||||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
|
||||||
if( pxTCB->uxPreemptionDisable == 0U )
|
|
||||||
#endif
|
|
||||||
{
|
|
||||||
xYieldRequired = pdTRUE;
|
xYieldRequired = pdTRUE;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
/* Setting the priority of any other task down does not
|
/* Setting the priority of any other task down does not
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue