summaryrefslogtreecommitdiffstats
path: root/BaseTools/Source/Python/build
diff options
context:
space:
mode:
authorFeng, Bob C <bob.c.feng@intel.com>2020-08-03 10:03:38 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2020-08-07 01:44:36 +0000
commitbfe36cb4efe577405aa4116a95e22a646fc8ee0c (patch)
tree895945ea76b8532260e80a577b73d8ffb81cb899 /BaseTools/Source/Python/build
parentdcf51c05e83809a73f29cb2dce9424e1838639cf (diff)
downloadedk2-bfe36cb4efe577405aa4116a95e22a646fc8ee0c.tar.gz
edk2-bfe36cb4efe577405aa4116a95e22a646fc8ee0c.tar.bz2
edk2-bfe36cb4efe577405aa4116a95e22a646fc8ee0c.zip
BaseTools: Improve the method of checking queue empty
Ref: https://bugzilla.tianocore.org/show_bug.cgi?id=2807 The Queue.empty() method is not reliable in the multiple process runtime environment. This patch uses a new method to check if all modules are processed and workers need to be stopped. That is to add a None item at the bottom of the queue. Worker check if it gets that None item to know if all the module is processed. Signed-off-by: Bob Feng <bob.c.feng@intel.com> Cc: Liming Gao <liming.gao@intel.com> Cc: Yuwei Chen <yuwei.chen@intel.com> Cc: Lucy Yan <lucyyan@google.com> Reviewed-by: Liming Gao <liming.gao@intel.com>
Diffstat (limited to 'BaseTools/Source/Python/build')
-rwxr-xr-xBaseTools/Source/Python/build/build.py3
1 files changed, 2 insertions, 1 deletions
diff --git a/BaseTools/Source/Python/build/build.py b/BaseTools/Source/Python/build/build.py
index 1ab1e60a64..59ceacfed0 100755
--- a/BaseTools/Source/Python/build/build.py
+++ b/BaseTools/Source/Python/build/build.py
@@ -1217,7 +1217,7 @@ class Build():
mqueue = mp.Queue()
for m in AutoGenObject.GetAllModuleInfo:
mqueue.put(m)
-
+ mqueue.put((None,None,None,None,None,None,None))
AutoGenObject.DataPipe.DataContainer = {"CommandTarget": self.Target}
AutoGenObject.DataPipe.DataContainer = {"Workspace_timestamp": AutoGenObject.Workspace._SrcTimeStamp}
AutoGenObject.CreateLibModuelDirs()
@@ -2174,6 +2174,7 @@ class Build():
data_pipe_file = os.path.join(Pa.BuildDir, "GlobalVar_%s_%s.bin" % (str(Pa.Guid),Pa.Arch))
Pa.DataPipe.dump(data_pipe_file)
+ mqueue.put((None,None,None,None,None,None,None))
autogen_rt, errorcode = self.StartAutoGen(mqueue, Pa.DataPipe, self.SkipAutoGen, PcdMaList, cqueue)
if not autogen_rt: