mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-04-19 21:11:57 -04:00
Update to FreeRTOS V6.1.0 release candidate.
This commit is contained in:
parent
4778bd45e7
commit
86e6ede04c
|
@ -460,15 +460,19 @@ tskTCB * pxNewTCB;
|
||||||
portENTER_CRITICAL();
|
portENTER_CRITICAL();
|
||||||
{
|
{
|
||||||
uxCurrentNumberOfTasks++;
|
uxCurrentNumberOfTasks++;
|
||||||
if( uxCurrentNumberOfTasks == ( unsigned portBASE_TYPE ) 1 )
|
if( pxCurrentTCB == NULL )
|
||||||
{
|
{
|
||||||
/* As this is the first task it must also be the current task. */
|
/* There are no other tasks, or all the other tasks are in
|
||||||
|
the suspended state - make this the current task. */
|
||||||
pxCurrentTCB = pxNewTCB;
|
pxCurrentTCB = pxNewTCB;
|
||||||
|
|
||||||
/* This is the first task to be created so do the preliminary
|
if( uxCurrentNumberOfTasks == ( unsigned portBASE_TYPE ) 1 )
|
||||||
initialisation required. We will not recover if this call
|
{
|
||||||
fails, but we will report the failure. */
|
/* This is the first task to be created so do the preliminary
|
||||||
prvInitialiseTaskLists();
|
initialisation required. We will not recover if this call
|
||||||
|
fails, but we will report the failure. */
|
||||||
|
prvInitialiseTaskLists();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
@ -893,10 +897,31 @@ tskTCB * pxNewTCB;
|
||||||
}
|
}
|
||||||
portEXIT_CRITICAL();
|
portEXIT_CRITICAL();
|
||||||
|
|
||||||
/* We may have just suspended the current task. */
|
if( ( void * ) pxTaskToSuspend == NULL )
|
||||||
if( ( ( void * ) pxTaskToSuspend == NULL ) && ( xSchedulerRunning != pdFALSE ) )
|
|
||||||
{
|
{
|
||||||
portYIELD_WITHIN_API();
|
if( xSchedulerRunning != pdFALSE )
|
||||||
|
{
|
||||||
|
/* We have just suspended the current task. */
|
||||||
|
portYIELD_WITHIN_API();
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
/* The scheduler is not running, but the task that was pointed
|
||||||
|
to by pxCurrentTCB has just been suspended and pxCurrentTCB
|
||||||
|
must be adjusted to point to a different task. */
|
||||||
|
if( uxCurrentNumberOfTasks == 1 )
|
||||||
|
{
|
||||||
|
/* No other tasks are defined, so set pxCurrentTCB back to
|
||||||
|
NULL so when the next task is created pxCurrentTCB will
|
||||||
|
be set to point to it no matter what its relative priority
|
||||||
|
is. */
|
||||||
|
pxCurrentTCB = NULL;
|
||||||
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
vTaskSwitchContext();
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue