def METHOD_NAME():
    state = []
    @forksafe.register
    def hook():
        state.append(1)
    def f1():
        return state
    def f2():
        return state
    def f3():
        return state
    pid = os.fork()
    if pid == 0:
        # child
        assert f1() == f2() == f3() == [1]
        os._exit(12)
    else:
        assert f1() == f2() == f3() == []
    _, status = os.waitpid(pid, 0)
    exit_code = os.WEXITSTATUS(status)
    assert exit_code == 12