\r
List<String> queueList = new ArrayList<String>();\r
\r
- public static Object deamonSemaphore = new Object();\r
+ public final static Object deamonSemaphore = new Object();\r
\r
- static Object countSemaphore = new Object();\r
+ private final static Object countSemaphore = new Object();\r
\r
public static int STATUS_DEPENDENCY_NOT_READY = 1;\r
\r
\r
public static int remainNumber = 0;\r
\r
+ public static ThreadGroup tg = new ThreadGroup("Framework");\r
+ \r
+ public static FpdModuleIdentification errorModule = null;\r
+ \r
/**\r
Public construct method. It is necessary for ANT task.\r
**/\r
// 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
//\r
// Exist ready thread\r
//\r
-// EdkLog.log(this, EdkLog.EDK_ALWAYS, "Exist ready thread");\r
+ EdkLog.log(this, EdkLog.EDK_DEBUG, "Exist ready thread");\r
\r
} else if (existNoneReady && currentRunNumber == 0) {\r
//\r
//\r
// Current queue build finish, move to next\r
//\r
- EdkLog.log(this, EdkLog.EDK_ALWAYS, "Current queue build finish, move to next");\r
+ EdkLog.log(this, EdkLog.EDK_DEBUG, "Current queue build finish, move to next");\r
++currentQueueCode;\r
continue ;\r
} else {\r
//\r
// active thread exist, but no ready thread\r
//\r
- EdkLog.log(this, EdkLog.EDK_ALWAYS, "Active thread exist, but no ready thread. Current running number is " + currentRunNumber);\r
+ EdkLog.log(this, EdkLog.EDK_DEBUG, "Active thread exist, but no ready thread. Current running number is " + currentRunNumber);\r
}\r
\r
try {\r
deamonSemaphore.wait();\r
+ \r
+ //\r
+ // if find error. Waiting running threads to finish\r
+ //\r
+ if (errorModule != null) {\r
+ while (currentRunNumber > 0) {\r
+ deamonSemaphore.wait();\r
+ }\r
+ \r
+ GenBuildLogger.setCacheEnable(false);\r
+ \r
+ GenBuildLogger.flushErrorModuleLog(errorModule);\r
+ \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
e.setStackTrace(ex.getStackTrace());\r
}\r
}\r
}\r
+ \r
GenBuildLogger.setCacheEnable(false);\r
//\r
// call fvs, postbuild\r
ant.execute();\r
\r
EdkLog.flushLogToFile(new File(buildDir + File.separatorChar + "build.log"));\r
- \r
}\r
\r
\r
//\r
// Generate GenBuildThread\r
//\r
- GenBuildThread genBuildThread = new GenBuildThread();\r
- genBuildThread.setArch(fpdModuleId.getArch());\r
+ GenBuildThread genBuildThread = new GenBuildThread(fpdModuleId.getModule(), fpdModuleId.getArch());\r
genBuildThread.setParentModuleId(null);\r
- genBuildThread.setModuleId(fpdModuleId.getModule());\r
genBuildThread.setProject(getProject());\r
\r
Set<FpdModuleIdentification> dependencies = new LinkedHashSet<FpdModuleIdentification>();\r
//\r
// Create thread for library instances\r
//\r
- GenBuildThread liBuildThread = new GenBuildThread();\r
- liBuildThread.setArch(fpdModuleId.getArch());\r
+ GenBuildThread liBuildThread = new GenBuildThread(libinstances[i], fpdModuleId.getArch());\r
liBuildThread.setParentModuleId(fpdModuleId.getModule());\r
- liBuildThread.setModuleId(libinstances[i]);\r
liBuildThread.setProject(getProject());\r
liBuildThread.setStatus(STATUS_DEPENDENCY_READY);\r
liBuildThread.setHighPriority(true);\r
updateFvs("libqueue", libFpdModuleId);\r
}\r
\r
- genBuildThread.setDependencies(dependencies); \r
+ genBuildThread.setDependencies(dependencies);\r
+ \r
// if (dependencies.size() == 0) {\r
genBuildThread.setStatus(STATUS_DEPENDENCY_READY);\r
// }\r