cosmopolitan/third_party/python/Lib/test/mp_preload.py
ahgamut 0c4c56ff39 python-3.6.zip added from Github
README.cosmo contains the necessary links.
2021-08-09 05:39:42 -07:00

18 lines
351 B
Python

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()