This commit is contained in:
shenjack 2021-09-24 14:52:41 +08:00
parent 2cf2db3b21
commit db3eb4cf3d

View File

@ -24,8 +24,8 @@ def new_thread(thread_name: Optional[str or Callable] = None, Daemon=False):
def wrap(*args, **kwargs): def wrap(*args, **kwargs):
thread_ = threading.Thread(target=func, args=args, kwargs=kwargs, name=thread_name) thread_ = threading.Thread(target=func, args=args, kwargs=kwargs, name=thread_name)
thread_.setDaemon(Daemon) thread_.setDaemon(Daemon)
crash.all_thread.append(thread_)
thread_.start() thread_.start()
crash.all_thread.append(thread_)
return thread return thread
# bring the signature of the func to the wrap function # bring the signature of the func to the wrap function