mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-10-13 16:27:43 -04:00
fix(freertos-smp): Fixed Lightweight Critical Sections for deferred state change
This commit is contained in:
parent
274fbb5beb
commit
4330d9073a
1 changed files with 3 additions and 12 deletions
15
tasks.c
15
tasks.c
|
@ -7850,12 +7850,7 @@ static void prvResetNextTaskUnblockTime( void )
|
|||
|
||||
portINCREMENT_CRITICAL_NESTING_COUNT( xCoreID );
|
||||
|
||||
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 1U
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
/* Check for the run state change of the task only if a deferred state change is not pending */
|
||||
&& pxCurrentTCB->uxDeferredStateChange == 0U
|
||||
#endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
|
||||
)
|
||||
if( portGET_CRITICAL_NESTING_COUNT( xCoreID ) == 1U )
|
||||
{
|
||||
prvLightWeightCheckForRunStateChange();
|
||||
}
|
||||
|
@ -7890,12 +7885,7 @@ static void prvResetNextTaskUnblockTime( void )
|
|||
{
|
||||
portENABLE_INTERRUPTS();
|
||||
|
||||
if( xYieldCurrentTask != pdFALSE
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
/* Yield only if no deferred state change is pending */
|
||||
&& pxCurrentTCB->uxDeferredStateChange == 0U
|
||||
#endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
|
||||
)
|
||||
if( xYieldCurrentTask != pdFALSE )
|
||||
{
|
||||
portYIELD();
|
||||
}
|
||||
|
@ -7917,6 +7907,7 @@ static void prvResetNextTaskUnblockTime( void )
|
|||
if( ( xYieldPendings[ xCoreID ] == pdTRUE ) && ( uxSchedulerSuspended == pdFALSE )
|
||||
#if ( configUSE_TASK_PREEMPTION_DISABLE == 1 )
|
||||
&& ( pxCurrentTCBs[ xCoreID ]->uxPreemptionDisable == 0U )
|
||||
&& ( pxCurrentTCBs[ xCoreID ]->uxDeferredStateChange == 0U )
|
||||
#endif /* ( configUSE_TASK_PREEMPTION_DISABLE == 1 ) */
|
||||
)
|
||||
{
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue