improve debugging

This commit is contained in:
holger krekel
2020-07-16 00:24:49 +02:00
parent 90be708791
commit e07869ae95
5 changed files with 16 additions and 7 deletions

View File

@@ -151,12 +151,12 @@ class EventThread(threading.Thread):
def mark_shutdown(self):
self._marked_for_shutdown = True
def wait(self):
def wait(self, timeout=None):
if self == threading.current_thread():
# we are in the callback thread and thus cannot
# wait for the thread-loop to finish.
return
self.join()
self.join(timeout=timeout)
def run(self):
""" get and run events until shutdown. """