Skip to content
Merged
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
Prev Previous commit
Next Next commit
unconditionally do a CAS
  • Loading branch information
picnixz committed Jul 6, 2026
commit dc7085966c31436ceec50fe2cdeee9eddb8442a2
4 changes: 0 additions & 4 deletions Modules/_hashopenssl.c
Original file line number Diff line number Diff line change
Expand Up @@ -712,7 +712,6 @@ get_openssl_evp_md_by_utf8name(_hashlibstate *state, const char *name,
* See https://github.com/python/cpython/issues/128657
* and https://github.com/python/cpython/issues/149816.
*/
#ifdef Py_GIL_DISABLED
PY_EVP_MD *expected = NULL;
if (_Py_atomic_compare_exchange_ptr(cached, &expected, (void *)fresh)) {
digest = fresh; // we won: 'cached' now owns the fresh digest
Expand All @@ -721,9 +720,6 @@ get_openssl_evp_md_by_utf8name(_hashlibstate *state, const char *name,
PY_EVP_MD_free(fresh); // we lost: discard the fresh digest
digest = expected; // reuse the winner's digest
}
#else
digest = *cached = fresh;
#endif
}
}
/* Hand the caller its own reference; the cache keeps its own. Valid
Expand Down