Increment the uxTaskNumber variable when a task is deleted in addition to when a task is created. This is to assist kernel aware debuggers detecting when the task list needs refreshing.

This commit is contained in:
Richard Barry 2009-03-14 15:04:44 +00:00
parent fa9a58c9c0
commit 42b60ed69c

View File

@ -143,9 +143,7 @@ static volatile unsigned portBASE_TYPE uxSchedulerSuspended = ( unsigned portBA
static volatile unsigned portBASE_TYPE uxMissedTicks = ( unsigned portBASE_TYPE ) 0;
static volatile portBASE_TYPE xMissedYield = ( portBASE_TYPE ) pdFALSE;
static volatile portBASE_TYPE xNumOfOverflows = ( portBASE_TYPE ) 0;
#if ( configUSE_TRACE_FACILITY == 1 )
static unsigned portBASE_TYPE uxTaskNumber = 0; /*lint !e956 Static is deliberate - this is guarded before use. */
#endif
static unsigned portBASE_TYPE uxTaskNumber = 0;
/* Debugging and trace facilities private variables and macros. ------------*/
@ -438,9 +436,9 @@ tskTCB * pxNewTCB;
{
/* Add a counter into the TCB for tracing only. */
pxNewTCB->uxTCBNumber = uxTaskNumber;
uxTaskNumber++;
}
#endif
uxTaskNumber++;
prvAddTaskToReadyQueue( pxNewTCB );
@ -518,6 +516,10 @@ tskTCB * pxNewTCB;
there is a task that has been deleted and that it should therefore
check the xTasksWaitingTermination list. */
++uxTasksDeleted;
/* Increment the uxTaskNumberVariable also so kernel aware debuggers
can detect that the task lists need re-generating. */
uxTaskNumber++;
}
taskEXIT_CRITICAL();