def start(self):
"""Starts this background thread."""
if not self._Thread__initialized:
raise RuntimeError('thread.__init__() not called')
if self._Thread__started.is_set():
raise RuntimeError('threads can only be started once')
with threading._active_limbo_lock:
threading._limbo[self] = self
try:
start_new_background_thread(self.__bootstrap, ())
except Exception:
with threading._active_limbo_lock:
del threading._limbo[self]
raise
self._Thread__started.wait()
background_thread.py 文件源码
python
阅读 25
收藏 0
点赞 0
评论 0
评论列表
文章目录