-
-
Notifications
You must be signed in to change notification settings - Fork 30.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
gh-126688: Reinit import lock after fork #126692
Conversation
The PyMutex implementation supports unlocking after fork because we clear the list of watiers in parking_lot.c. This doesn't work as well for _PyRecursiveMutex because on some systems, such as SerenityOS, the thread id is not preserved across fork().
Thanks @oskar-skog. My first attempt had a bug and I also had to merge "main" back into the PR branch to fix some other test issues. Sorry if that complicated applying the diff to 3.13. You may already know this, but you can get the PR as a diff with a URL like https://github.com/python/cpython/pull/126692.patch. That's sometimes easier to apply than diffing between two commits involving merges. |
No, it actually made it simpler to patch, and I didn't know you could just download a PR as a patch. |
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
Thanks @colesbury for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
The PyMutex implementation supports unlocking after fork because we clear the list of waiters in parking_lot.c. This doesn't work as well for _PyRecursiveMutex because on some systems, such as SerenityOS, the thread id is not preserved across fork(). (cherry picked from commit 5610860) Co-authored-by: Sam Gross <[email protected]>
GH-126765 is a backport of this pull request to the 3.13 branch. |
The PyMutex implementation supports unlocking after fork because we clear the list of waiters in parking_lot.c. This doesn't work as well for _PyRecursiveMutex because on some systems, such as SerenityOS, the thread id is not preserved across fork(). (cherry picked from commit 5610860) Co-authored-by: Sam Gross <[email protected]>
The
PyMutex
implementation supports unlocking after fork because we clear the list of watiers in parking_lot.c. This doesn't work as well for_PyRecursiveMutex
because on some systems, such as SerenityOS, the thread id is not preserved acrossfork()
.