File tree Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Expand file tree Collapse file tree 1 file changed +4
-7
lines changed Original file line number Diff line number Diff line change @@ -657,21 +657,18 @@ list_item(PyObject *aa, Py_ssize_t i)
657
657
return NULL ;
658
658
}
659
659
#ifdef Py_GIL_DISABLED
660
+ if (!_Py_IsOwnedByCurrentThread ((PyObject * )a ) && !_PyObject_GC_IS_SHARED (a )) {
661
+ _PyObject_GC_SET_SHARED (a );
662
+ }
660
663
PyObject * * ob_item = _Py_atomic_load_ptr (& a -> ob_item );
661
664
item = _Py_atomic_load_ptr (& ob_item [i ]);
662
665
if (item && _Py_TryIncrefCompare (& ob_item [i ], item )) {
663
- goto end ;
666
+ return item ;
664
667
}
665
668
#endif
666
669
Py_BEGIN_CRITICAL_SECTION (a );
667
670
item = Py_NewRef (a -> ob_item [i ]);
668
671
Py_END_CRITICAL_SECTION ();
669
- #ifdef Py_GIL_DISABLED
670
- end :
671
- if (!_Py_IsOwnedByCurrentThread ((PyObject * )a ) && !_PyObject_GC_IS_SHARED (a )) {
672
- _PyObject_GC_SET_SHARED (a );
673
- }
674
- #endif
675
672
return item ;
676
673
}
677
674
You can’t perform that action at this time.
0 commit comments