Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

gh-112075: Make PyDictKeysObject thread-safe #114741

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

Merged
merged 6 commits into from
Feb 21, 2024
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Next Next commit
Make PyDictKeysObject thread-safe
  • Loading branch information
DinoV committed Feb 20, 2024
commit 4715734a37f564b95823ec1e021b540ca429870c
6 changes: 6 additions & 0 deletions 6 Include/internal/pycore_dict.h
Original file line number Diff line number Diff line change
Expand Up @@ -136,6 +136,11 @@ struct _dictkeysobject {
/* Kind of keys */
uint8_t dk_kind;

#ifdef Py_GIL_DISABLED
/* Lock used to protect shared keys */
PyMutex dk_mutex;
#endif

/* Version number -- Reset to 0 by any modification to keys */
uint32_t dk_version;

Expand All @@ -145,6 +150,7 @@ struct _dictkeysobject {
/* Number of used entries in dk_entries. */
Py_ssize_t dk_nentries;


/* Actual hash table of dk_size entries. It holds indices in dk_entries,
or DKIX_EMPTY(-1) or DKIX_DUMMY(-2).

Expand Down
Loading
Morty Proxy This is a proxified and sanitized view of the page, visit original site.