MCPcopy Index your code
hub / github.com/python/cpython / test_lock

Method test_lock

Lib/test/_test_multiprocessing.py:5861–5870  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

5859
5860 @warnings_helper.ignore_fork_in_thread_deprecation_warnings()
5861 def test_lock(self):
5862 r, w = multiprocessing.Pipe(False)
5863 l = util.ForkAwareThreadLock()
5864 old_size = len(util._afterfork_registry)
5865 p = multiprocessing.Process(target=self.child, args=(5, w))
5866 p.start()
5867 w.close()
5868 new_size = r.recv()
5869 join_process(p)
5870 self.assertLessEqual(new_size, old_size)
5871
5872#
5873# Check that non-forked child processes do not inherit unneeded fds/handles

Callers

nothing calls this directly

Calls 7

join_processFunction · 0.85
PipeMethod · 0.80
assertLessEqualMethod · 0.80
ProcessMethod · 0.45
startMethod · 0.45
closeMethod · 0.45
recvMethod · 0.45

Tested by

no test coverage detected