gateway_base.py 文件源码

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

项目:execnet 作者: pytest-dev 项目源码 文件源码
def _terminate_execution(self):
        # called from receiverthread
        self._trace("shutting down execution pool")
        self._execpool.trigger_shutdown()
        if not self._execpool.waitall(5.0):
            self._trace(
                "execution ongoing after 5 secs,"" trying interrupt_main")
            # We try hard to terminate execution based on the assumption
            # that there is only one gateway object running per-process.
            if sys.platform != "win32":
                self._trace("sending ourselves a SIGINT")
                os.kill(os.getpid(), 2)  # send ourselves a SIGINT
            elif interrupt_main is not None:
                self._trace("calling interrupt_main()")
                interrupt_main()
            if not self._execpool.waitall(10.0):
                self._trace("execution did not finish in another 10 secs, "
                            "calling os._exit()")
                os._exit(1)
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号