Moved the clear action to the place before exiting scheduler
authorjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 30 Nov 2007 09:27:35 +0000 (09:27 +0000)
committerjwang36 <jwang36@7335b38e-4728-0410-8992-fb3ffe349368>
Fri, 30 Nov 2007 09:27:35 +0000 (09:27 +0000)
git-svn-id: https://buildtools.tianocore.org/svn/buildtools/trunk/BaseTools@898 7335b38e-4728-0410-8992-fb3ffe349368

Source/Python/build/build.py

index 73635da..5b52bab 100644 (file)
@@ -321,14 +321,6 @@ class BuildTask:
     #\r
     @staticmethod\r
     def StartScheduler(MaxThreadNumber, ExitFlag):\r
     #\r
     @staticmethod\r
     def StartScheduler(MaxThreadNumber, ExitFlag):\r
-        BuildTask._PendingQueue.clear()\r
-        BuildTask._ReadyQueue.clear()\r
-        BuildTask._RunningQueue.clear()\r
-        BuildTask._TaskQueue.clear()\r
-        BuildTask._ErrorFlag.clear()\r
-        BuildTask._ErrorMessage = ""\r
-        BuildTask._Thread = None\r
-\r
         SchedulerThread = Thread(target=BuildTask.Scheduler, args=(MaxThreadNumber, ExitFlag))\r
         SchedulerThread.setName("Build-Task-Scheduler")\r
         SchedulerThread.setDaemon(False)\r
         SchedulerThread = Thread(target=BuildTask.Scheduler, args=(MaxThreadNumber, ExitFlag))\r
         SchedulerThread.setName("Build-Task-Scheduler")\r
         SchedulerThread.setDaemon(False)\r
@@ -409,6 +401,11 @@ class BuildTask:
             EdkLogger.SetLevel(EdkLogger.QUIET)\r
             BuildTask._ErrorFlag.set()\r
             BuildTask._ErrorMessage = "build thread scheduler error\n\t%s" % str(X)\r
             EdkLogger.SetLevel(EdkLogger.QUIET)\r
             BuildTask._ErrorFlag.set()\r
             BuildTask._ErrorMessage = "build thread scheduler error\n\t%s" % str(X)\r
+\r
+        BuildTask._PendingQueue.clear()\r
+        BuildTask._ReadyQueue.clear()\r
+        BuildTask._RunningQueue.clear()\r
+        BuildTask._TaskQueue.clear()\r
         BuildTask._SchedulerStopped.set()\r
 \r
     ## Wait for all running method exit\r
         BuildTask._SchedulerStopped.set()\r
 \r
     ## Wait for all running method exit\r