()
| 55 | /// Must only be called from single-threaded child after fork(). |
| 56 | #[cfg(unix)] |
| 57 | pub(crate) unsafe fn reinit_after_fork() { |
| 58 | if IMP_LOCK.is_locked() && !IMP_LOCK.is_owned_by_current_thread() { |
| 59 | // Held by a dead thread — reset to unlocked. |
| 60 | unsafe { rustpython_common::lock::zero_reinit_after_fork(&IMP_LOCK) }; |
| 61 | } |
| 62 | } |
| 63 | |
| 64 | /// Match CPython's `_PyImport_ReInitLock()` + `_PyImport_ReleaseLock()` |
| 65 | /// behavior in the post-fork child: |
no test coverage detected