Handle task manager shutdown more correctly
If a task manager was stopped with tasks in queue, they would not be processed. This could result in deadlocked threads if one of the long-running threads was waiting on a task while the main thread shut down a manager. Change-Id: I3f58c599d472d134984e63b41e9d493be9e9d70b
This commit is contained in:
parent
0dc4b59b7d
commit
8ccc227b2d
@ -71,9 +71,11 @@ class TaskManager(threading.Thread):
|
||||
|
||||
def run(self):
|
||||
last_ts = 0
|
||||
while self._running:
|
||||
while True:
|
||||
task = self.queue.get()
|
||||
if not task:
|
||||
if not self._running:
|
||||
break
|
||||
continue
|
||||
while True:
|
||||
delta = time.time() - last_ts
|
||||
|
Loading…
x
Reference in New Issue
Block a user