summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAníbal Limón <anibal.limon@linux.intel.com>2016-10-04 11:45:53 -0500
committerRichard Purdie <richard.purdie@linuxfoundation.org>2016-10-05 10:10:11 +0100
commitf2053844958325496a9387874a8f3182400b71ca (patch)
tree72c61f69154c655cb3ef0dc716f81a4c53f9cb19
parentf1f6993c729aee2f7c273b66376cf0b688482450 (diff)
downloadpoky-f2053844958325496a9387874a8f3182400b71ca.tar.gz
classes/sstate.bbclass: Enable thread lock when checkstatus
The checkstatus function fires an event to notify bitbake UI about the progress of the task, this function is implemented using ThreadPool and is causing event lose when multiple threads tries to fire an event (writes over socket/fd). [YOCTO #10330] (From OE-Core rev: 6e0bb9d141438c0051c32b0d3a247915b71ccb82) Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com> Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
-rw-r--r--meta/classes/sstate.bbclass4
1 files changed, 4 insertions, 0 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass
index 6f0c791fe5..172384b376 100644
--- a/meta/classes/sstate.bbclass
+++ b/meta/classes/sstate.bbclass
@@ -851,15 +851,19 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False):
851 851
852 if tasklist: 852 if tasklist:
853 bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d) 853 bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d)
854
854 import multiprocessing 855 import multiprocessing
855 nproc = min(multiprocessing.cpu_count(), len(tasklist)) 856 nproc = min(multiprocessing.cpu_count(), len(tasklist))
856 857
858 bb.event.enable_threadlock()
857 pool = oe.utils.ThreadedPool(nproc, len(tasklist), 859 pool = oe.utils.ThreadedPool(nproc, len(tasklist),
858 worker_init=checkstatus_init, worker_end=checkstatus_end) 860 worker_init=checkstatus_init, worker_end=checkstatus_end)
859 for t in tasklist: 861 for t in tasklist:
860 pool.add_task(checkstatus, t) 862 pool.add_task(checkstatus, t)
861 pool.start() 863 pool.start()
862 pool.wait_completion() 864 pool.wait_completion()
865 bb.event.disable_threadlock()
866
863 bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d) 867 bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d)
864 if whitelist and missing: 868 if whitelist and missing:
865 bb.fatal('Required artifacts were unavailable - exiting') 869 bb.fatal('Required artifacts were unavailable - exiting')