Add timeout to thread join calls to avoid deadlocks
This commit is contained in:
parent
dc1e646308
commit
17065b4c7e
|
@ -412,7 +412,8 @@ class Powerline(object):
|
|||
'''
|
||||
self.shutdown_event.set()
|
||||
if self.use_daemon_threads and self.is_alive():
|
||||
self.thread.join()
|
||||
# Give the worker thread a chance to shutdown, but don't block for too long
|
||||
self.thread.join(.01)
|
||||
self.renderer.shutdown()
|
||||
self.watcher.unsubscribe()
|
||||
|
||||
|
|
|
@ -77,7 +77,8 @@ class ThreadedSegment(object):
|
|||
def shutdown(self):
|
||||
self.shutdown_event.set()
|
||||
if self.daemon and self.is_alive():
|
||||
self.thread.join()
|
||||
# Give the worker thread a chance to shutdown, but don't block for too long
|
||||
self.thread.join(.01)
|
||||
|
||||
def set_interval(self, interval=None):
|
||||
# Allowing “interval” keyword in configuration.
|
||||
|
|
Loading…
Reference in New Issue