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:27:30 +0100 |
commit | 3fa32158c45edf276197fa56466ed942ab70be09 (patch) | |
tree | 478c1a26e5ce6e7d2456c0d895ebf4ff170e5c61 /meta/classes | |
parent | 18e902b2dc17746af453869bcc1fba4dbae7c94f (diff) | |
download | poky-3fa32158c45edf276197fa56466ed942ab70be09.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.
(From OE-Core rev: 524d92ed7b53bef933527095e82f378b934f25ef)
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 1e5e98a1da..a80d1ced72 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): | |||
771 | bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) | 771 | bb.note("Checking sstate mirror object availability (for %s objects)" % len(tasklist)) |
772 | import multiprocessing | 772 | import multiprocessing |
773 | nproc = min(multiprocessing.cpu_count(), len(tasklist)) | 773 | nproc = min(multiprocessing.cpu_count(), len(tasklist)) |
774 | pool = oe.utils.ThreadedPool(nproc) | 774 | pool = oe.utils.ThreadedPool(nproc, len(tasklist)) |
775 | for t in tasklist: | 775 | for t in tasklist: |
776 | pool.add_task(checkstatus, t) | 776 | pool.add_task(checkstatus, t) |
777 | pool.start() | ||
777 | pool.wait_completion() | 778 | pool.wait_completion() |
778 | 779 | ||
779 | inheritlist = d.getVar("INHERIT", True) | 780 | inheritlist = d.getVar("INHERIT", True) |