]> git.proxmox.com Git - mirror_edk2.git/blobdiff - Tools/Source/GenBuild/org/tianocore/build/fpd/FpdParserForThread.java
Update LOG process.
[mirror_edk2.git] / Tools / Source / GenBuild / org / tianocore / build / fpd / FpdParserForThread.java
index 8767b8ff976f2b77d5420aabfe9bd8ca06e190d7..de9a28c7d5abf5f84a1e75c2269c8ed26d059553 100644 (file)
@@ -67,7 +67,7 @@ public class FpdParserForThread extends FpdParserTask {
     \r
     public static ThreadGroup tg = new ThreadGroup("Framework");\r
     \r
-    public static boolean isError = false;\r
+    public static FpdModuleIdentification errorModule = null;\r
     \r
     /**\r
       Public construct method. It is necessary for ANT task.\r
@@ -163,10 +163,7 @@ public class FpdParserForThread extends FpdParserTask {
         // Waiting for all thread over, or time out\r
         //\r
         synchronized (deamonSemaphore) {\r
-            //\r
-            // Initialize BUGBUG\r
-            //\r
-            \r
+\r
             while (true) {\r
                 //\r
                 // If all modules are already built\r
@@ -231,15 +228,22 @@ public class FpdParserForThread extends FpdParserTask {
 \r
                 try {\r
                     deamonSemaphore.wait();\r
-                    if (isError) {\r
+                    \r
+                    //\r
+                    // if find error. Let other threads to finish\r
+                    //\r
+                    if (errorModule != null) {\r
+                        while (currentRunNumber > 0) {\r
+                            deamonSemaphore.wait();\r
+                        }\r
+                        \r
                         GenBuildLogger.setCacheEnable(false);\r
-                        EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));\r
                         \r
-                        GenBuildLogger.maskAllLog(true);\r
-                        FpdParserForThread.tg.destroy();\r
-                        GenBuildLogger.maskAllLog(false);\r
+                        GenBuildLogger.flushErrorModuleLog(errorModule);\r
                         \r
-                        throw new BuildException("One thread error. ");\r
+                        EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));\r
+                        \r
+                        throw new BuildException(errorModule + " build error. ");\r
                     }\r
                 } catch (InterruptedException ex) {\r
                     BuildException e = new BuildException("Thread wait Error. \n" + ex.getMessage());\r
@@ -270,7 +274,6 @@ public class FpdParserForThread extends FpdParserTask {
         ant.execute();\r
         \r
         EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));\r
-        \r
     }\r
 \r
     \r