mirror of
https://github.com/python/cpython.git
synced 2026-06-23 11:33:30 -04:00
gh-151223: fix tsan data races in load global specializations (#151393)
This commit is contained in:
+3
-3
@@ -2349,7 +2349,7 @@ dummy_func(
|
||||
assert(keys->dk_kind == DICT_KEYS_UNICODE);
|
||||
PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(keys);
|
||||
assert(index < DK_SIZE(keys));
|
||||
PyObject *res_o = FT_ATOMIC_LOAD_PTR_RELAXED(entries[index].me_value);
|
||||
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
|
||||
DEOPT_IF(res_o == NULL);
|
||||
#if Py_GIL_DISABLED
|
||||
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
|
||||
@@ -2368,7 +2368,7 @@ dummy_func(
|
||||
DEOPT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != version);
|
||||
assert(keys->dk_kind == DICT_KEYS_UNICODE);
|
||||
PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(keys);
|
||||
PyObject *res_o = FT_ATOMIC_LOAD_PTR_RELAXED(entries[index].me_value);
|
||||
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
|
||||
DEOPT_IF(res_o == NULL);
|
||||
#if Py_GIL_DISABLED
|
||||
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
|
||||
@@ -2958,7 +2958,7 @@ dummy_func(
|
||||
assert(keys->dk_kind == DICT_KEYS_UNICODE);
|
||||
assert(index < FT_ATOMIC_LOAD_SSIZE_RELAXED(keys->dk_nentries));
|
||||
PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(keys) + index;
|
||||
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_RELAXED(ep->me_value);
|
||||
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_CONSUME(ep->me_value);
|
||||
EXIT_IF(attr_o == NULL);
|
||||
#ifdef Py_GIL_DISABLED
|
||||
int increfed = _Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr);
|
||||
|
||||
Reference in New Issue
Block a user