We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 581869e commit 96be738Copy full SHA for 96be738
Python/specialize.c
@@ -976,8 +976,13 @@ specialize_inline_values_access_lock_held(
976
_PyAttrCache *cache = (_PyAttrCache *)(instr + 1);
977
assert(PyUnicode_CheckExact(name));
978
_Py_CRITICAL_SECTION_ASSERT_OBJECT_LOCKED(owner);
979
- uint32_t version;
980
- Py_ssize_t index = _PyDictKeys_StringLookupAndVersion(keys, name, &version);
+ #ifdef Py_GIL_DISABLED
+ PyMutex_LockFlags(&keys->dk_mutex, _Py_LOCK_DONT_DETACH);
981
+ #endif
982
+ Py_ssize_t index = _PyDictKeys_StringLookup(keys, name);
983
984
+ PyMutex_Unlock(&keys->dk_mutex);
985
986
assert (index != DKIX_ERROR);
987
if (index == DKIX_EMPTY) {
988
SPECIALIZATION_FAIL(base_op, SPEC_FAIL_ATTR_NOT_IN_KEYS);
0 commit comments