def start(self, isLastRun = True):
self.__set_run_event(True)
if not self.__started:
threading.Thread.start(self)
self.__exit = isLastRun
def exit(self):
## if self.__RunningEvent.isSet():
## raise RuntimeError("thread still running")
self.__exit = True
self.__set_run_event(True)
def is_running(self):
return self.__RunningEvent.isSet()
def __del__(self):
self.__exit = True
if not self.__RunningEvent.isSet():
self.__set_run_event(True)
def join(self):
if self.__RunningEvent.isSet():
self.__RunEndEvent.wait()
threadpool 5
最新推荐文章于 2024-06-05 17:26:25 发布