aboutsummaryrefslogtreecommitdiffstats
path: root/lib/bb/cooker.py
diff options
context:
space:
mode:
authorRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-22 15:10:41 +0100
committerRichard Purdie <richard.purdie@linuxfoundation.org>2020-08-23 00:00:04 +0100
commit51ba35e9bbd4da8b5f3b3b5b8213cb634a6b0f06 (patch)
tree3b256f7ecec524e4b2cecd93b1d377aa1c67cf8e /lib/bb/cooker.py
parent06b7bafbd18a47c8db2f7b943dc535c65df176bf (diff)
downloadbitbake-51ba35e9bbd4da8b5f3b3b5b8213cb634a6b0f06.tar.gz
cooker: Ensure parse_quit thread is closed down
Each run through the parser would leak a thread from the queue created to shut the parser down. Close this down correctly and clean up the code flow slightly whilst in the area, making sure this thread does shut down correctly (we don't care if it loses data). Signed-off-by: Richard Purdie <richard.purdie@linuxfoundation.org>
Diffstat (limited to 'lib/bb/cooker.py')
-rw-r--r--lib/bb/cooker.py14
1 files changed, 8 insertions, 6 deletions
diff --git a/lib/bb/cooker.py b/lib/bb/cooker.py
index 912360546..05be9bef6 100644
--- a/lib/bb/cooker.py
+++ b/lib/bb/cooker.py
@@ -2103,12 +2103,11 @@ class CookerParser(object):
self.total)
bb.event.fire(event, self.cfgdata)
- for process in self.processes:
- self.parser_quit.put(None)
- else:
- self.parser_quit.cancel_join_thread()
- for process in self.processes:
- self.parser_quit.put(None)
+
+ # Allow data left in the cancel queue to be discarded
+ self.parser_quit.cancel_join_thread()
+ for process in self.processes:
+ self.parser_quit.put(None)
# Cleanup the queue before call process.join(), otherwise there might be
# deadlocks.
@@ -2125,6 +2124,9 @@ class CookerParser(object):
else:
process.join()
+ self.parser_quit.close()
+ self.parser_quit.join_thread()
+
def sync_caches():
for c in self.bb_caches.values():
c.sync()