@@ -7716,8 +7716,20 @@ static void prvResetNextTaskUnblockTime( void )
77167716 {
77177717 BaseType_t xYieldCurrentTask ;
77187718
7719- /* Get the xYieldPending stats inside the critical section. */
7720- xYieldCurrentTask = xTaskUnlockCanYield ();
7719+ /* Get the xYieldPending status inside the critical section. */
7720+ if ( ( xYieldPendings [ xCoreID ] == pdTRUE ) && ( uxSchedulerSuspended == pdFALSE )
7721+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
7722+ && ( pxCurrentTCBs [ xCoreID ]-> uxPreemptionDisable == 0U ) &&
7723+ ( pxCurrentTCBs [ xCoreID ]-> uxDeferredStateChange == 0U )
7724+ #endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
7725+ )
7726+ {
7727+ xYieldCurrentTask = pdTRUE ;
7728+ }
7729+ else
7730+ {
7731+ xYieldCurrentTask = pdFALSE ;
7732+ }
77217733
77227734 /* Release the ISR and task locks first when using granular locks. */
77237735 kernelRELEASE_ISR_LOCK ( xCoreID );
@@ -7872,15 +7884,27 @@ static void prvResetNextTaskUnblockTime( void )
78727884
78737885 if ( portGET_CRITICAL_NESTING_COUNT ( xCoreID ) > 0U )
78747886 {
7887+ BaseType_t xYieldCurrentTask ;
7888+
7889+ if ( ( xYieldPendings [ xCoreID ] == pdTRUE ) && ( uxSchedulerSuspended == pdFALSE )
7890+ #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
7891+ && ( pxCurrentTCBs [ xCoreID ]-> uxPreemptionDisable == 0U ) &&
7892+ ( pxCurrentTCBs [ xCoreID ]-> uxDeferredStateChange == 0U )
7893+ #endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
7894+ )
7895+ {
7896+ xYieldCurrentTask = pdTRUE ;
7897+ }
7898+ else
7899+ {
7900+ xYieldCurrentTask = pdFALSE ;
7901+ }
7902+
78757903 /* Release the ISR lock */
78767904 kernelRELEASE_ISR_LOCK ( xCoreID );
78777905
78787906 portDECREMENT_CRITICAL_NESTING_COUNT ( xCoreID );
78797907
7880- BaseType_t xYieldCurrentTask ;
7881-
7882- xYieldCurrentTask = xTaskUnlockCanYield ();
7883-
78847908 /* If the critical nesting count is 0, enable interrupts */
78857909 if ( portGET_CRITICAL_NESTING_COUNT ( xCoreID ) == 0U )
78867910 {
@@ -7898,33 +7922,6 @@ static void prvResetNextTaskUnblockTime( void )
78987922#endif /* #if ( configLIGHTWEIGHT_CRITICAL_SECTION == 1 ) */
78997923/*-----------------------------------------------------------*/
79007924
7901- #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) )
7902-
7903- BaseType_t xTaskUnlockCanYield ( void )
7904- {
7905- BaseType_t xReturn ;
7906- BaseType_t xCoreID = portGET_CORE_ID ();
7907-
7908- if ( ( xYieldPendings [ xCoreID ] == pdTRUE ) && ( uxSchedulerSuspended == pdFALSE )
7909- #if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
7910- && ( pxCurrentTCBs [ xCoreID ]-> uxPreemptionDisable == 0U ) &&
7911- ( pxCurrentTCBs [ xCoreID ]-> uxDeferredStateChange == 0U )
7912- #endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
7913- )
7914- {
7915- xReturn = pdTRUE ;
7916- }
7917- else
7918- {
7919- xReturn = pdFALSE ;
7920- }
7921-
7922- return xReturn ;
7923- }
7924-
7925- #endif /* #if ( ( portUSING_GRANULAR_LOCKS == 1 ) && ( configNUMBER_OF_CORES > 1 ) ) */
7926- /*-----------------------------------------------------------*/
7927-
79287925#if ( configUSE_STATS_FORMATTING_FUNCTIONS > 0 )
79297926
79307927 static char * prvWriteNameToBuffer ( char * pcBuffer ,
0 commit comments