mirror of
https://github.com/python/cpython.git
synced 2025-10-28 09:10:36 +00:00
gh-117657: Fix TSAN list set failure (#118260)
* Fix TSAN list set failure * Relaxed atomic is sufficient, add targetted test * More list * Remove atomic assign in list * Fixup white space
This commit is contained in:
parent
8ed5466795
commit
1e67b9207c
3 changed files with 90 additions and 3 deletions
|
|
@ -28,7 +28,11 @@ _PyList_AppendTakeRef(PyListObject *self, PyObject *newitem)
|
|||
Py_ssize_t allocated = self->allocated;
|
||||
assert((size_t)len + 1 < PY_SSIZE_T_MAX);
|
||||
if (allocated > len) {
|
||||
#ifdef Py_GIL_DISABLED
|
||||
_Py_atomic_store_ptr_release(&self->ob_item[len], newitem);
|
||||
#else
|
||||
PyList_SET_ITEM(self, len, newitem);
|
||||
#endif
|
||||
Py_SET_SIZE(self, len + 1);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue