You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Make _struct module thread-safe in --disable-gil builds #112062
The use of PyDict_GetItemWithError returns a borrowed reference (should use PyDict_GetItemRef)
The state->cache is lazily created; we should instead create it during _structmodule_exec
We want state->cache to be an immutable reference to a mutable dict. (The dict will be thread-safe.) Use PyDict_Clear to empty the dict instead of clearing the reference.
See the commit from the nogil-3.12 fork for context: colesbury/nogil-3.12@ada9b73feb. Note that in CPython the relevant function is PyDict_GetItemRef not PyDict_FetchItemWithError.
Activity
chgnrdv commentedon Nov 14, 2023
I'll submit a PR :)
gh-112062: Make `_struct` module thread-safe in `--disable-gil` builds (
pythongh-112062: Make `_struct` module thread-safe in `--disable-gil`…
pythongh-112062: Make `_struct` module thread-safe in `--disable-gil`…