-
-
Notifications
You must be signed in to change notification settings - Fork 31.2k
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-112062: Make _struct
module thread-safe in --disable-gil
builds
#112094
gh-112062: Make _struct
module thread-safe in --disable-gil
builds
#112094
Conversation
* use `PyDict_GetItemRef` instead of `PyDict_GetItemWithError` in `cache_struct_converter` to avoid usage of borrowed ref with explicit incref * clear cache dict but preserve the reference in `_clearcache_impl` * create cache dict in `_structmodule_exec`
Thanks @chgnrdv. This is going to conflict with @serhiy-storchaka's #112076, which also makes Maybe remove that part and just keep the changes to |
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.
Thanks, this lgtm. @kumaraditya303, would you please review this change?
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
… builds (python#112094) * pythongh-112062: Make `_struct` module thread-safe in --disable-gil builds
… builds (python#112094) * pythongh-112062: Make `_struct` module thread-safe in --disable-gil builds
Fixes #112062
_clearcache_impl
_structmodule_exec
_struct
module thread-safe in--disable-gil
builds #112062