From e6bcb220dd32ce938000988744dad559e17f832b Mon Sep 17 00:00:00 2001 From: richardbarry Date: Sat, 14 Mar 2009 15:04:44 +0000 Subject: [PATCH] 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. git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@707 1d2547de-c912-0410-9cb9-b8ca96c0e9e2 --- Source/tasks.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/Source/tasks.c b/Source/tasks.c index 0a363ecc0..0c53f03e7 100644 --- a/Source/tasks.c +++ b/Source/tasks.c @@ -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(); -- 2.39.5