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.
Signed-off-by: Chris Larson <chris_larson@mentor.com>
import threading
import multiprocessing
import signal
+import atexit
from cStringIO import StringIO
from contextlib import closing
import bb
self.task_queue.close()
for process in self.processes:
process.join()
- threading.Thread(target=self.bb_cache.sync).start()
+ sync = threading.Thread(target=self.bb_cache.sync)
+ sync.start()
+ atexit.register(lambda: sync.join())
if self.error > 0:
raise ParsingErrorsFound()