diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2016-10-04 11:45:53 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2016-10-05 00:15:29 +0100 |
commit | 6e0bb9d141438c0051c32b0d3a247915b71ccb82 (patch) | |
tree | c1b99197cba1bc902d047abae439174917fab8ec /meta | |
parent | c0a22a8d3e5d44ae3fba14a52582d39cfc600318 (diff) | |
download | openembedded-core-6e0bb9d141438c0051c32b0d3a247915b71ccb82.tar.gz openembedded-core-6e0bb9d141438c0051c32b0d3a247915b71ccb82.tar.bz2 openembedded-core-6e0bb9d141438c0051c32b0d3a247915b71ccb82.zip |
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]
Signed-off-by: Aníbal Limón <anibal.limon@linux.intel.com>
Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'meta')
-rw-r--r-- | meta/classes/sstate.bbclass | 4 |
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): if tasklist: bb.event.fire(bb.event.ProcessStarted("Checking sstate mirror object availability", len(tasklist)), d) + import multiprocessing nproc = min(multiprocessing.cpu_count(), len(tasklist)) + bb.event.enable_threadlock() pool = oe.utils.ThreadedPool(nproc, len(tasklist), worker_init=checkstatus_init, worker_end=checkstatus_end) for t in tasklist: pool.add_task(checkstatus, t) pool.start() pool.wait_completion() + bb.event.disable_threadlock() + bb.event.fire(bb.event.ProcessFinished("Checking sstate mirror object availability"), d) if whitelist and missing: bb.fatal('Required artifacts were unavailable - exiting') |