summaryrefslogtreecommitdiffstats
path: root/Objects/object.c
diff options
context:
space:
mode:
Diffstat (limited to 'Objects/object.c')
-rw-r--r--Objects/object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/Objects/object.c b/Objects/object.c
index b115bc7..8868fa2 100644
--- a/Objects/object.c
+++ b/Objects/object.c
@@ -119,7 +119,7 @@ get_reftotal(PyInterpreterState *interp)
since we can't determine which interpreter updated it. */
Py_ssize_t total = REFTOTAL(interp);
#ifdef Py_GIL_DISABLED
- for (PyThreadState *p = interp->threads.head; p != NULL; p = p->next) {
+ _Py_FOR_EACH_TSTATE_UNLOCKED(interp, p) {
/* This may race with other threads modifications to their reftotal */
_PyThreadStateImpl *tstate_impl = (_PyThreadStateImpl *)p;
total += _Py_atomic_load_ssize_relaxed(&tstate_impl->reftotal);