MCPcopy Index your code
hub / github.com/RustPython/RustPython / test_lock

Method test_lock

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

Source from the content-addressed store, hash-verified

5526 conn.close()
5527
5528 def test_lock(self):
5529 r, w = multiprocessing.Pipe(False)
5530 l = util.ForkAwareThreadLock()
5531 old_size = len(util._afterfork_registry)
5532 p = multiprocessing.Process(target=self.child, args=(5, w))
5533 p.start()
5534 w.close()
5535 new_size = r.recv()
5536 join_process(p)
5537 self.assertLessEqual(new_size, old_size)
5538
5539#
5540# Check that non-forked child processes do not inherit unneeded fds/handles

Callers

nothing calls this directly

Calls 8

lenFunction · 0.85
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