-
-
Notifications
You must be signed in to change notification settings - Fork 33.7k
gh-116738: Add critical section to dbm/gdbm context manager #140391
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
serhiy-storchaka
left a comment
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. 👍
colesbury
left a comment
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 as well.
FYI, you can also use Argument Clinic for __enter__ and __exit__ functions now if you prefer Argument Clinic boilerplate to Py_BEGIN_CRITICAL_SECTION boilerplate.
|
Thanks @yoney for the PR, and @colesbury for merging it 🌮🎉.. I'm working now to backport this PR to: 3.14. |
…thongh-140391) (cherry picked from commit d51be28) Co-authored-by: Alper <[email protected]>
|
GH-140459 is a backport of this pull request to the 3.14 branch. |
…h-140391) (gh-140459) (cherry picked from commit d51be28) Co-authored-by: Alper <[email protected]>
Add
Py_{BEGIN,END}_CRITICAL_SECTION()to the context managers in thedbmandgdbmmodules for the free threading build. Other methods are already covered.This could be a problem in a rare corner case if a thread outlives the context manager's scope. I created a local test, and TSAN identifies the issue.
cc: @mpage @colesbury