diff options
author | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-22 15:10:41 +0100 |
---|---|---|
committer | Richard Purdie <richard.purdie@linuxfoundation.org> | 2020-08-24 09:08:14 +0100 |
commit | b991cc4f8954711add94514f7d59efd68cb29ac7 (patch) | |
tree | b10899b3ecfde7be653c06d4fd3514a5796fb9da | |
parent | e4df6ef7f537ea86c8da98ef7dd724d89d7f35cb (diff) | |
download | poky-b991cc4f8954711add94514f7d59efd68cb29ac7.tar.gz |
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 <richard.purdie@linuxfoundation.org>
-rw-r--r-- | bitbake/lib/bb/cooker.py | 14 |
1 files changed, 8 insertions, 6 deletions
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): | |||
2103 | self.total) | 2103 | self.total) |
2104 | 2104 | ||
2105 | bb.event.fire(event, self.cfgdata) | 2105 | bb.event.fire(event, self.cfgdata) |
2106 | for process in self.processes: | 2106 | |
2107 | self.parser_quit.put(None) | 2107 | # Allow data left in the cancel queue to be discarded |
2108 | else: | 2108 | self.parser_quit.cancel_join_thread() |
2109 | self.parser_quit.cancel_join_thread() | 2109 | for process in self.processes: |
2110 | for process in self.processes: | 2110 | self.parser_quit.put(None) |
2111 | self.parser_quit.put(None) | ||
2112 | 2111 | ||
2113 | # Cleanup the queue before call process.join(), otherwise there might be | 2112 | # Cleanup the queue before call process.join(), otherwise there might be |
2114 | # deadlocks. | 2113 | # deadlocks. |
@@ -2125,6 +2124,9 @@ class CookerParser(object): | |||
2125 | else: | 2124 | else: |
2126 | process.join() | 2125 | process.join() |
2127 | 2126 | ||
2127 | self.parser_quit.close() | ||
2128 | self.parser_quit.join_thread() | ||
2129 | |||
2128 | def sync_caches(): | 2130 | def sync_caches(): |
2129 | for c in self.bb_caches.values(): | 2131 | for c in self.bb_caches.values(): |
2130 | c.sync() | 2132 | c.sync() |