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

Function _prepareFork

Lib/logging/__init__.py:231–243  ·  view source on GitHub ↗

Prepare to fork a new child process by acquiring the module-level lock. This should be used in conjunction with _afterFork().

()

Source from the content-addressed store, hash-verified

229_lock = threading.RLock()
230
231def _prepareFork():
232 """
233 Prepare to fork a new child process by acquiring the module-level lock.
234
235 This should be used in conjunction with _afterFork().
236 """
237 # Wrap the lock acquisition in a try-except to prevent the lock from being
238 # abandoned in the event of an asynchronous exception. See gh-106238.
239 try:
240 _lock.acquire()
241 except BaseException:
242 _lock.release()
243 raise
244
245def _afterFork():
246 """

Callers

nothing calls this directly

Calls 2

acquireMethod · 0.45
releaseMethod · 0.45

Tested by

no test coverage detected