// wait at most 5 second for all processes to be
// finished by themselves.
if any(x.worker.is_alive() for x in self.procs + self.pool if x.worker):
time.sleep(0.01)
cnt += 1
else:
return
// if the workers cannot kill themselves, give a warning
After Change
def terminate(self) -> None:
for proc in self.procs + self.pool:
if proc is None:
continue
close_socket(proc.socket)
class Base_Executor:
"""This is the base class of all executor that provides common