mirror of
https://github.com/powerline/powerline.git
synced 2025-07-06 13:34:58 +02:00
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()
|
self.shutdown_event.set()
|
||||||
if self.use_daemon_threads and self.is_alive():
|
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.renderer.shutdown()
|
||||||
self.watcher.unsubscribe()
|
self.watcher.unsubscribe()
|
||||||
|
|
||||||
|
@ -77,7 +77,8 @@ class ThreadedSegment(object):
|
|||||||
def shutdown(self):
|
def shutdown(self):
|
||||||
self.shutdown_event.set()
|
self.shutdown_event.set()
|
||||||
if self.daemon and self.is_alive():
|
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):
|
def set_interval(self, interval=None):
|
||||||
# Allowing “interval” keyword in configuration.
|
# Allowing “interval” keyword in configuration.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user