File tree 1 file changed +3
-2
lines changed
1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 8
8
#include "pycore_long.h" // _PyLong_DigitCount
9
9
#include "pycore_modsupport.h" // _PyArg_NoKwnames()
10
10
#include "pycore_object.h" // _PyObject_GC_TRACK(), _PyDebugAllocatorStats()
11
+ #include "pycore_pyatomic_ft_wrappers.h"
11
12
#include "pycore_tuple.h" // _PyTuple_FromArray()
12
13
#include <stddef.h>
13
14
@@ -3399,7 +3400,7 @@ listiter_len(PyObject *self, PyObject *Py_UNUSED(ignored))
3399
3400
_PyListIterObject * it = (_PyListIterObject * )self ;
3400
3401
Py_ssize_t len ;
3401
3402
if (it -> it_seq ) {
3402
- len = PyList_GET_SIZE (it -> it_seq ) - it -> it_index ;
3403
+ len = PyList_GET_SIZE (it -> it_seq ) - FT_ATOMIC_LOAD_SSIZE_RELAXED ( it -> it_index ) ;
3403
3404
if (len >= 0 )
3404
3405
return PyLong_FromSsize_t (len );
3405
3406
}
@@ -3424,7 +3425,7 @@ listiter_setstate(PyObject *self, PyObject *state)
3424
3425
index = 0 ;
3425
3426
else if (index > PyList_GET_SIZE (it -> it_seq ))
3426
3427
index = PyList_GET_SIZE (it -> it_seq ); /* iterator exhausted */
3427
- it -> it_index = index ;
3428
+ FT_ATOMIC_STORE_SSIZE_RELAXED ( it -> it_index , index ) ;
3428
3429
}
3429
3430
Py_RETURN_NONE ;
3430
3431
}
You can’t perform that action at this time.
0 commit comments