ping_object.py 文件源码

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

项目:any_ping_indicator 作者: leggedrobotics 项目源码 文件源码
def stop(self):
        """Join the thread. Kill the running subprocess and interrupt the sleeping.
        :return:
        """
        self.is_running = False
        if self.thread is not None:
            # kill subprocess
            if self.process is not None:
                print("kill process")
                try:
                    os.killpg(os.getpgid(self.process.pid), signal.SIGTERM)
                except ProcessLookupError as e:
                    print(e)
            # interrupt sleeping
            self.stop_event.set()
            self.stop_event = None
            self.thread.join()
            self.thread = None
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号