Your IP : 216.73.216.74


Current Path : /proc/self/root/proc/self/root/usr/local/python-3.9/lib/python3.9/test/
Upload File :
Current File : //proc/self/root/proc/self/root/usr/local/python-3.9/lib/python3.9/test/mp_preload.py

import multiprocessing

multiprocessing.Lock()


def f():
    print("ok")


if __name__ == "__main__":
    ctx = multiprocessing.get_context("forkserver")
    modname = "test.mp_preload"
    # Make sure it's importable
    __import__(modname)
    ctx.set_forkserver_preload([modname])
    proc = ctx.Process(target=f)
    proc.start()
    proc.join()