mx.py 文件源码

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

项目:mx 作者: graalvm 项目源码 文件源码
def _kill_process(pid, sig):
    """
    Sends the signal `sig` to the process identified by `pid`. If `pid` is a process group
    leader, then signal is sent to the process group id.
    """
    pgid = os.getpgid(pid)
    try:
        logvv('[{} sending {} to {}]'.format(os.getpid(), sig, pid))
        if pgid == pid:
            os.killpg(pgid, sig)
        else:
            os.kill(pid, sig)
        return True
    except:
        log('Error killing subprocess ' + str(pid) + ': ' + str(sys.exc_info()[1]))
        return False
评论列表
文章目录


问题


面经


文章

微信
公众号

扫码关注公众号