service.py 文件源码

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

项目:bilean 作者: openstack 项目源码 文件源码
def stop(self, graceful=False):
        '''Stop any active threads belong to this threadgroup.'''
        # Try to stop all threads gracefully
        self.group.stop(graceful)
        self.group.wait()

        # Wait for link()ed functions (i.e. lock release)
        threads = self.group.threads[:]
        links_done = dict((th, False) for th in threads)

        def mark_done(gt, th):
            links_done[th] = True

        for th in threads:
            th.link(mark_done, th)

        while not all(links_done.values()):
            eventlet.sleep()
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号