diff options
author | Aníbal Limón <anibal.limon@linux.intel.com> | 2015-06-23 11:49:53 -0500 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2015-06-26 09:25:50 +0100 |
commit | 524d92ed7b53bef933527095e82f378b934f25ef (patch) | |
tree | b6fb65d2634631b09b420e71ad6c41f8b4b95684 /meta/classes | |
parent | 2587b83faabdc8858e8746201805369ed8d53ba8 (diff) | |
download | openembedded-core-contrib-524d92ed7b53bef933527095e82f378b934f25ef.tar.gz |
oe/utils.py: Fix thread leakage in ThreadPool
In order to fix Thread leakage caused by not call join() in Threads,
Pass num_tasks in ThreadPool for add all the tasks into a Queue this
enable catch of Queue.Empty exception and exit the threads.
classes/sstate.bbclass: Change checkstatus function to match new
ThreadPool operation.
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/classes')
-rw-r--r-- | meta/classes/sstate.bbclass | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/meta/classes/sstate.bbclass b/meta/classes/sstate.bbclass index 1e5e98a1da0..a80d1ced72b 100644 --- a/meta/classes/sstate.bbclass +++ b/meta/classes/sstate.bbclass @@ -771,9 +771,10 @@ def sstate_checkhashes(sq_fn, sq_task, sq_hash, sq_hashfn, d, siginfo=False): bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) import multiprocessing nproc = min(multiprocessing.cpu_count(), len(tasklist)) - pool = oe.utils.ThreadedPool(nproc) + pool = oe.utils.ThreadedPool(nproc, len(tasklist)) for t in tasklist: pool.add_task(checkstatus, t) + pool.start() pool.wait_completion() inheritlist = d.getVar("INHERIT", True) |