mirror of
https://github.com/TheFunny/ArisuAutoSweeper
synced 2026-10-21 20:22:18 +00:00
fix: allow gracefully exit of workers when killed
This commit is contained in:
@@ -239,7 +239,7 @@ class WorkerThread:
|
|||||||
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(
|
res = ctypes.pythonapi.PyThreadState_SetAsyncExc(
|
||||||
thread_id, ctypes.py_object(_JobKill))
|
thread_id, ctypes.py_object(_JobKill))
|
||||||
if res <= 1:
|
if res <= 1:
|
||||||
del self.thread_pool.all_workers[self]
|
self.thread_pool.all_workers.pop(self, None)
|
||||||
self.thread_pool.release_full_lock()
|
self.thread_pool.release_full_lock()
|
||||||
return True
|
return True
|
||||||
else:
|
else:
|
||||||
|
|||||||
Reference in New Issue
Block a user