8000 gh-132013: use relaxed atomics in hash of frozenset by kumaraditya303 · Pull Request #132014 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content

gh-132013: use relaxed atomics in hash of frozenset #132014

8000
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 1 commit into from
Apr 2, 2025
Merged
Changes from all commits
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
6 changes: 3 additions & 3 deletions Objects/setobject.c
Original file line number Diff line number Diff line change
Expand Up @@ -793,12 +793,12 @@ frozenset_hash(PyObject *self)
PySetObject *so = _PySet_CAST(self);
Py_uhash_t hash;

if (so->hash != -1) {
return so->hash;
if (FT_ATOMIC_LOAD_SSIZE_RELAXED(so->hash) != -1) {
return FT_ATOMIC_LOAD_SSIZE_RELAXED(so->hash);
}

hash = frozenset_hash_impl(self);
so->hash = hash;
FT_ATOMIC_STORE_SSIZE_RELAXED(so->hash, hash);
return hash;
}

Expand Down
Loading
0