diff --git a/tasks.c b/tasks.c index 96fc80075..8e671ee35 100644 --- a/tasks.c +++ b/tasks.c @@ -3334,7 +3334,7 @@ static void prvInitialiseNewTask( TaskFunction_t pxTaskCode, } else { - if( ( taskTASK_IS_RUNNING( pxTCB ) == pdTRUE ) ) + if( xYieldPendings[ pxTCB->xTaskRunState ] != pdFALSE && ( taskTASK_IS_RUNNING( pxTCB ) != pdFALSE ) ) { prvYieldCore( pxTCB->xTaskRunState ); }