We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 100c7ab commit f895ca9Copy full SHA for f895ca9
1 file changed
Objects/listobject.c
@@ -656,6 +656,16 @@ list_item(PyObject *aa, Py_ssize_t i)
656
return NULL;
657
}
658
PyObject *item;
659
+#ifdef Py_GIL_DISABLED
660
+ PyObject **ob_item = _Py_atomic_load_ptr(&a->ob_item);
661
+ item = _Py_TryXGetRef(&ob_item[i]);
662
+ if (item) {
663
+ if (_Py_atomic_load_ptr(&ob_item[i]) == item) {
664
+ return item;
665
+ }
666
+ Py_DECREF(item);
667
668
+#endif
669
Py_BEGIN_CRITICAL_SECTION(a);
670
#ifdef Py_GIL_DISABLED
671
if (!_Py_IsOwnedByCurrentThread((PyObject *)a) && !_PyObject_GC_IS_SHARED(a)) {
0 commit comments