8000
We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 02560da 10000 commit 1c15fb2Copy full SHA for 1c15fb2
Objects/listobject.c
@@ -657,21 +657,18 @@ list_item(PyObject *aa, Py_ssize_t i)
657
return NULL;
658
}
659
#ifdef Py_GIL_DISABLED
660
+ if (!_Py_IsOwnedByCurrentThread((PyObject *)a) && !_PyObject_GC_IS_SHARED(a)) {
661
+ _PyObject_GC_SET_SHARED(a);
662
+ }
663
PyObject **ob_item = _Py_atomic_load_ptr(&a->ob_item);
664
item = _Py_atomic_load_ptr(&ob_item[i]);
665
if (item && _Py_TryIncrefCompare(&ob_item[i], item)) {
- goto end;
666
+ return item;
667
668
#endif
669
Py_BEGIN_CRITICAL_SECTION(a);
670
item = Py_NewRef(a->ob_item[i]);
671
Py_END_CRITICAL_SECTION();
-#ifdef Py_GIL_DISABLED
-end:
- if (!_Py_IsOwnedByCurrentThread((PyObject *)a) && !_PyObject_GC_IS_SHARED(a)) {
672
- _PyObject_GC_SET_SHARED(a);
673
- }
674
-#endif
675
return item;
676
677
0 commit comments