summaryrefslogtreecommitdiffstats
path: root/Include/internal/pycore_list.h
diff options
context:
space:
mode:
Diffstat (limited to 'Include/internal/pycore_list.h')
-rw-r--r--Include/internal/pycore_list.h4
1 files changed, 4 insertions, 0 deletions
diff --git a/Include/internal/pycore_list.h b/Include/internal/pycore_list.h
index 2a82912..73695d1 100644
--- a/Include/internal/pycore_list.h
+++ b/Include/internal/pycore_list.h
@@ -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;
}