Avoid raise RuntimeError(cannot join current thread)

This commit is contained in:
Artem Lavrenov 2023-01-28 12:26:25 +03:00
parent 9fb5f89f18
commit b9bedef73f
1 changed files with 2 additions and 1 deletions

View File

@ -154,7 +154,8 @@ class ThreadPool:
for worker in self.workers:
worker.stop()
for worker in self.workers:
worker.join()
if worker != threading.current_thread():
worker.join()
class AsyncTask: