mirror of
https://github.com/python/cpython.git
synced 2026-01-06 07:22:09 +00:00
[3.13] gh-129643: Fix PyList_Insert in free-threading builds (GH-129680) (#129725)
(cherry picked from commit 63f0406d5a)
This commit is contained in:
parent
fc78ed9e6f
commit
8529d6414f
2 changed files with 3 additions and 2 deletions
|
|
@ -0,0 +1 @@
|
|||
Fix thread safety of :c:func:`PyList_Insert` in free-threading builds.
|
||||
|
|
@ -498,8 +498,8 @@ ins1(PyListObject *self, Py_ssize_t where, PyObject *v)
|
|||
where = n;
|
||||
items = self->ob_item;
|
||||
for (i = n; --i >= where; )
|
||||
items[i+1] = items[i];
|
||||
items[where] = Py_NewRef(v);
|
||||
FT_ATOMIC_STORE_PTR_RELAXED(items[i+1], items[i]);
|
||||
FT_ATOMIC_STORE_PTR_RELEASE(items[where], Py_NewRef(v));
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue