diff options
author | Chris Larson <chris_larson@mentor.com> | 2010-11-23 11:46:49 -0600 |
---|---|---|
committer | Richard Purdie <rpurdie@linux.intel.com> | 2011-01-04 14:46:44 +0000 |
commit | 7a7e2f4e59a076ce166da53af5d8bbec310b1665 (patch) | |
tree | 3afc07f4c048e22466acc622e8072562c9d047ef /bitbake/lib/bb/cooker.py | |
parent | f4a06aac980f73702a04d2c2f0728c09ebfb7786 (diff) | |
download | poky-7a7e2f4e59a076ce166da53af5d8bbec310b1665.tar.gz |
cooker: ensure that the cache sync completes
Without explicitly joining the thread, it's possible for the process to end
(e.g. after a bitbake -p) and kill off the thread without waiting for it to
exit cleanly. So, register the thread join with atexit.
(Bitbake rev: 97ce57e6f860d3e6f34cc7a603ed1eeac4f423d3)
Signed-off-by: Chris Larson <chris_larson@mentor.com>
Signed-off-by: Richard Purdie <rpurdie@linux.intel.com>
Diffstat (limited to 'bitbake/lib/bb/cooker.py')
-rw-r--r-- | bitbake/lib/bb/cooker.py | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/bitbake/lib/bb/cooker.py b/bitbake/lib/bb/cooker.py index 69098ccf91..0ed70f9bd8 100644 --- a/bitbake/lib/bb/cooker.py +++ b/bitbake/lib/bb/cooker.py | |||
@@ -28,6 +28,7 @@ import sre_constants | |||
28 | import threading | 28 | import threading |
29 | import multiprocessing | 29 | import multiprocessing |
30 | import signal | 30 | import signal |
31 | import atexit | ||
31 | from cStringIO import StringIO | 32 | from cStringIO import StringIO |
32 | from contextlib import closing | 33 | from contextlib import closing |
33 | import bb | 34 | import bb |
@@ -1038,8 +1039,12 @@ class CookerParser(object): | |||
1038 | self.task_queue.close() | 1039 | self.task_queue.close() |
1039 | for process in self.processes: | 1040 | for process in self.processes: |
1040 | process.join() | 1041 | process.join() |
1041 | threading.Thread(target=self.bb_cache.sync).start() | 1042 | sync = threading.Thread(target=self.bb_cache.sync) |
1042 | threading.Thread(target=bb.codeparser.parser_cache_save(self.cooker.configuration.data)).start() | 1043 | sync.start() |
1044 | atexit.register(lambda: sync.join()) | ||
1045 | codesync = threading.Thread(target=bb.codeparser.parser_cache_save(self.cooker.configuration.data)) | ||
1046 | codesync.start() | ||
1047 | atexit.register(lambda: codesync.join()) | ||
1043 | if self.error > 0: | 1048 | if self.error > 0: |
1044 | raise ParsingErrorsFound() | 1049 | raise ParsingErrorsFound() |
1045 | 1050 | ||