-
-
Notifications
You must be signed in to change notification settings - Fork 31.8k
gh-131544: Update docs for PyType_AddWatcher #132015
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
Conversation
The reason why we decided to update the documentation: #131544 (comment) |
Doc/c-api/type.rst
Outdated
@@ -82,6 +82,9 @@ Type Objects | |||
error (e.g. no more watcher IDs available), return ``-1`` and set an | |||
exception. | |||
|
|||
In free-threaded builds, :c:func:`PyType_AddWatcher` is not thread-safe, | |||
so it must be called at start up. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
maybe: "so it must be called at start up (before spawning the first thread)."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Thanks @corona10 for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13. |
(cherry picked from commit 25275bd) Co-authored-by: Donghee Na <donghee.na@python.org>
GH-132019 is a backport of this pull request to the 3.13 branch. |
PyType_AddWatcher
and friends are not thread safe in free-threading #131544📚 Documentation preview 📚: https://cpython-previews--132015.org.readthedocs.build/