Fixed multi-target build issue.
[people/mcb30/basetools.git] / Source / Python / build / build.py
index 45e9c74..73635da 100644 (file)
@@ -321,6 +321,14 @@ class BuildTask:
     #\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