From b991cc4f8954711add94514f7d59efd68cb29ac7 Mon Sep 17 00:00:00 2001 From: Richard Purdie Date: Sat, 22 Aug 2020 15:10:41 +0100 Subject: bitbake: 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). (Bitbake rev: 51ba35e9bbd4da8b5f3b3b5b8213cb634a6b0f06) Signed-off-by: Richard Purdie --- bitbake/lib/bb/cooker.py | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) (limited to 'bitbake/lib') diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 9123605461..05be9bef67 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/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() -- cgit v1.2.3-54-g00ecf