threading.py 文件源码

python
阅读 23 收藏 0 点赞 0 评论 0

项目:Deploy_XXNET_Server 作者: jzp820927 项目源码 文件源码
def start(self):
        if not self.__initialized:
            raise RuntimeError("thread.__init__() not called")
        if self.__started.is_set():
            raise RuntimeError("threads can only be started once")
        if __debug__:
            self._note("%s.start(): starting thread", self)
        with _active_limbo_lock:
            _limbo[self] = self
        try:
            _start_new_thread(self.__bootstrap, ())
        except Exception:
            with _active_limbo_lock:
                # NOTE(google) Added 'in' check. This handles the possibility of
                # an asynchronous exception (e.g., DeadlineExceededError) being
                # thrown inside of __bootstrap_inner after it removes self from
                # _limbo, causing a KeyError to be raised here. It is safe to
                # ignore such an error, because it means self has already been
                # removed from _limbo.
                if self in _limbo:
                    del _limbo[self]
            raise
        self.__started.wait()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号