Remove obsolete code from prvCheckTasksWaitingTermination().

This commit is contained in:
Richard Barry 2017-05-29 22:55:09 +00:00
parent 533b533820
commit b5d8be2209
2 changed files with 19 additions and 26 deletions

View file

@ -159,6 +159,9 @@ volatile long l1, l2;
TaskHandle_t xTaskToKill;
const TickType_t xDelay = pdMS_TO_TICKS( ( TickType_t ) 200 );
/* Test deletion of a task's secure context, if any. */
portTASK_CALLS_SECURE_FUNCTIONS();
if( pvParameters != NULL )
{
/* This task is periodically created four times. Two created tasks are

View file

@ -3265,6 +3265,11 @@ static portTASK_FUNCTION( prvIdleTask, pvParameters )
/** THIS IS THE RTOS IDLE TASK - WHICH IS CREATED AUTOMATICALLY WHEN THE
SCHEDULER IS STARTED. **/
/* In case a task that has a secure context deletes itself, in which case
the idle task is responsible for deleting the task's secure context, if
any. */
portTASK_CALLS_SECURE_FUNCTIONS();
for( ;; )
{
/* See if any tasks have deleted themselves - if so then the idle task
@ -3502,23 +3507,13 @@ static void prvCheckTasksWaitingTermination( void )
/** THIS FUNCTION IS CALLED FROM THE RTOS IDLE TASK **/
#if ( INCLUDE_vTaskDelete == 1 )
{
BaseType_t xListIsEmpty;
/* ucTasksDeleted is used to prevent vTaskSuspendAll() being called
too often in the idle task. */
while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )
{
vTaskSuspendAll();
{
xListIsEmpty = listLIST_IS_EMPTY( &xTasksWaitingTermination );
}
( void ) xTaskResumeAll();
if( xListIsEmpty == pdFALSE )
{
TCB_t *pxTCB;
/* uxDeletedTasksWaitingCleanUp is used to prevent vTaskSuspendAll()
being called too often in the idle task. */
while( uxDeletedTasksWaitingCleanUp > ( UBaseType_t ) 0U )
{
taskENTER_CRITICAL();
{
pxTCB = ( TCB_t * ) listGET_OWNER_OF_HEAD_ENTRY( ( &xTasksWaitingTermination ) );
@ -3530,11 +3525,6 @@ static void prvCheckTasksWaitingTermination( void )
prvDeleteTCB( pxTCB );
}
else
{
mtCOVERAGE_TEST_MARKER();
}
}
}
#endif /* INCLUDE_vTaskDelete */
}
@ -3763,7 +3753,7 @@ static void prvCheckTasksWaitingTermination( void )
{
/* Neither the stack nor the TCB were allocated dynamically, so
nothing needs to be freed. */
configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB )
configASSERT( pxTCB->ucStaticallyAllocated == tskSTATICALLY_ALLOCATED_STACK_AND_TCB );
mtCOVERAGE_TEST_MARKER();
}
}