@@ -1085,12 +1085,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
1085
1085
#endif
1086
1086
{
1087
1087
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
1088
+ {
1088
1089
if ( pxCurrentTCBs [ xCoreID ]-> uxPreemptionDisable == 0U )
1089
- #endif
1090
+ {
1091
+ xLowestPriorityToPreempt = xCurrentCoreTaskPriority ;
1092
+ xLowestPriorityCore = xCoreID ;
1093
+ }
1094
+ else
1095
+ {
1096
+ xYieldPendings [ xCoreID ] = pdTRUE ;
1097
+ }
1098
+ }
1099
+ #else
1090
1100
{
1091
1101
xLowestPriorityToPreempt = xCurrentCoreTaskPriority ;
1092
1102
xLowestPriorityCore = xCoreID ;
1093
1103
}
1104
+ #endif
1094
1105
}
1095
1106
}
1096
1107
else
@@ -1391,12 +1402,23 @@ static void prvAddNewTaskToReadyList( TCB_t * pxNewTCB ) PRIVILEGED_FUNCTION;
1391
1402
( xYieldPendings [ uxCore ] == pdFALSE ) )
1392
1403
{
1393
1404
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
1405
+ {
1394
1406
if ( pxCurrentTCBs [ uxCore ]-> uxPreemptionDisable == 0U )
1395
- #endif
1407
+ {
1408
+ xLowestPriority = xTaskPriority ;
1409
+ xLowestPriorityCore = ( BaseType_t ) uxCore ;
1410
+ }
1411
+ else
1412
+ {
1413
+ xYieldPendings [ uxCore ] = pdTRUE ;
1414
+ }
1415
+ }
1416
+ #else
1396
1417
{
1397
1418
xLowestPriority = xTaskPriority ;
1398
1419
xLowestPriorityCore = ( BaseType_t ) uxCore ;
1399
1420
}
1421
+ #endif
1400
1422
}
1401
1423
}
1402
1424
}
@@ -3053,12 +3075,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode,
3053
3075
/* Setting the priority of a running task down means
3054
3076
* there may now be another task of higher priority that
3055
3077
* is ready to execute. */
3056
- #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
3057
- if ( pxTCB -> uxPreemptionDisable == 0U )
3058
- #endif
3059
- {
3060
- xYieldRequired = pdTRUE ;
3061
- }
3078
+ xYieldRequired = pdTRUE ;
3062
3079
}
3063
3080
else
3064
3081
{
0 commit comments