Skip to content

Commit ac03f20

Browse files
fix false tsan data races in load global specializations
1 parent c375992 commit ac03f20

4 files changed

Lines changed: 12 additions & 12 deletions

File tree

Modules/_testinternalcapi/test_cases.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/bytecodes.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2349,7 +2349,7 @@ dummy_func(
23492349
assert(keys->dk_kind == DICT_KEYS_UNICODE);
23502350
PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(keys);
23512351
assert(index < DK_SIZE(keys));
2352-
PyObject *res_o = FT_ATOMIC_LOAD_PTR_RELAXED(entries[index].me_value);
2352+
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
23532353
DEOPT_IF(res_o == NULL);
23542354
#if Py_GIL_DISABLED
23552355
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
@@ -2368,7 +2368,7 @@ dummy_func(
23682368
DEOPT_IF(FT_ATOMIC_LOAD_UINT32_RELAXED(keys->dk_version) != version);
23692369
assert(keys->dk_kind == DICT_KEYS_UNICODE);
23702370
PyDictUnicodeEntry *entries = DK_UNICODE_ENTRIES(keys);
2371-
PyObject *res_o = FT_ATOMIC_LOAD_PTR_RELAXED(entries[index].me_value);
2371+
PyObject *res_o = FT_ATOMIC_LOAD_PTR_CONSUME(entries[index].me_value);
23722372
DEOPT_IF(res_o == NULL);
23732373
#if Py_GIL_DISABLED
23742374
int increfed = _Py_TryIncrefCompareStackRef(&entries[index].me_value, res_o, &res);
@@ -2958,7 +2958,7 @@ dummy_func(
29582958
assert(keys->dk_kind == DICT_KEYS_UNICODE);
29592959
assert(index < FT_ATOMIC_LOAD_SSIZE_RELAXED(keys->dk_nentries));
29602960
PyDictUnicodeEntry *ep = DK_UNICODE_ENTRIES(keys) + index;
2961-
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_RELAXED(ep->me_value);
2961+
PyObject *attr_o = FT_ATOMIC_LOAD_PTR_CONSUME(ep->me_value);
29622962
EXIT_IF(attr_o == NULL);
29632963
#ifdef Py_GIL_DISABLED
29642964
int increfed = _Py_TryIncrefCompareStackRef(&ep->me_value, attr_o, &attr);

Python/executor_cases.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Python/generated_cases.c.h

Lines changed: 3 additions & 3 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)