summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--meta/conf/bitbake.conf2
-rw-r--r--meta/lib/oe/utils.py12
2 files changed, 10 insertions, 4 deletions
diff --git a/meta/conf/bitbake.conf b/meta/conf/bitbake.conf
index 47b564fbab..8b26461874 100644
--- a/meta/conf/bitbake.conf
+++ b/meta/conf/bitbake.conf
@@ -975,5 +975,5 @@ BB_UNIHASH ?= "${BB_TASKHASH}"
975oe.sstatesig.find_sstate_manifest[vardepsexclude] = "BBEXTENDCURR BBEXTENDVARIANT OVERRIDES PACKAGE_EXTRA_ARCHS" 975oe.sstatesig.find_sstate_manifest[vardepsexclude] = "BBEXTENDCURR BBEXTENDVARIANT OVERRIDES PACKAGE_EXTRA_ARCHS"
976oe.utils.get_multilib_datastore[vardepsexclude] = "DEFAULTTUNE_MULTILIB_ORIGINAL OVERRIDES" 976oe.utils.get_multilib_datastore[vardepsexclude] = "DEFAULTTUNE_MULTILIB_ORIGINAL OVERRIDES"
977oe.path.format_display[vardepsexclude] = "TOPDIR" 977oe.path.format_display[vardepsexclude] = "TOPDIR"
978oe.utils.multiprocess_launch[vardepsexclude] = "BB_NUMBER_THREADS" 978oe.utils.get_bb_number_threads[vardepsexclude] = "BB_NUMBER_THREADS"
979oe.packagedata.emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS" 979oe.packagedata.emit_pkgdata[vardepsexclude] = "BB_NUMBER_THREADS"
diff --git a/meta/lib/oe/utils.py b/meta/lib/oe/utils.py
index 1658f3555d..a3b1bb1087 100644
--- a/meta/lib/oe/utils.py
+++ b/meta/lib/oe/utils.py
@@ -264,10 +264,17 @@ def execute_pre_post_process(d, cmds):
264 bb.note("Executing %s ..." % cmd) 264 bb.note("Executing %s ..." % cmd)
265 bb.build.exec_func(cmd, d) 265 bb.build.exec_func(cmd, d)
266 266
267# For each item in items, call the function 'target' with item as the first 267def get_bb_number_threads(d):
268 return int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1)
269
270def multiprocess_launch(target, items, d, extraargs=None):
271 max_process = get_bb_number_threads(d)
272 return multiprocess_launch_mp(target, items, max_process, extraargs)
273
274# For each item in items, call the function 'target' with item as the first
268# argument, extraargs as the other arguments and handle any exceptions in the 275# argument, extraargs as the other arguments and handle any exceptions in the
269# parent thread 276# parent thread
270def multiprocess_launch(target, items, d, extraargs=None): 277def multiprocess_launch_mp(target, items, max_process, extraargs=None):
271 278
272 class ProcessLaunch(multiprocessing.Process): 279 class ProcessLaunch(multiprocessing.Process):
273 def __init__(self, *args, **kwargs): 280 def __init__(self, *args, **kwargs):
@@ -302,7 +309,6 @@ def multiprocess_launch(target, items, d, extraargs=None):
302 self.update() 309 self.update()
303 return self._result 310 return self._result
304 311
305 max_process = int(d.getVar("BB_NUMBER_THREADS") or os.cpu_count() or 1)
306 launched = [] 312 launched = []
307 errors = [] 313 errors = []
308 results = [] 314 results = []