]> git.sur5r.net Git - freertos/commitdiff
Increment the uxTaskNumber variable when a task is deleted in addition to when a...
authorrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 14 Mar 2009 15:04:44 +0000 (15:04 +0000)
committerrichardbarry <richardbarry@1d2547de-c912-0410-9cb9-b8ca96c0e9e2>
Sat, 14 Mar 2009 15:04:44 +0000 (15:04 +0000)
git-svn-id: https://svn.code.sf.net/p/freertos/code/trunk@707 1d2547de-c912-0410-9cb9-b8ca96c0e9e2

Source/tasks.c

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