]> git.ipfire.org Git - thirdparty/openembedded/openembedded-core-contrib.git/commitdiff
classes/sstate.bbclass: Enable thread lock when checkstatus
authorAníbal Limón <anibal.limon@linux.intel.com>
Tue, 4 Oct 2016 16:45:53 +0000 (11:45 -0500)
committerRichard Purdie <richard.purdie@linuxfoundation.org>
Tue, 4 Oct 2016 23:15:29 +0000 (00:15 +0100)
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>
meta/classes/sstate.bbclass

index 6f0c791fe5065dcf50bfb72b8cf3153d9d60ed68..172384b37636956aa9e6c912f260e73539d25a86 100644 (file)
@@ -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')