diff options
Diffstat (limited to 'Lib/test/mp_preload.py')
-rw-r--r-- | Lib/test/mp_preload.py | 18 |
1 files changed, 18 insertions, 0 deletions
diff --git a/Lib/test/mp_preload.py b/Lib/test/mp_preload.py new file mode 100644 index 0000000..5314e8f --- /dev/null +++ b/Lib/test/mp_preload.py @@ -0,0 +1,18 @@ +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() |