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 2bb60d9 commit 3798bedCopy full SHA for 3798bed
Objects/object.c
@@ -118,11 +118,13 @@ get_reftotal(PyInterpreterState *interp)
118
since we can't determine which interpreter updated it. */
119
Py_ssize_t total = REFTOTAL(interp);
120
#ifdef Py_GIL_DISABLED
121
+ INTERP_HEAD_LOCK(interp);
122
for (PyThreadState *p = interp->threads.head; p != NULL; p = p->next) {
123
/* This may race with other threads modifications to their reftotal */
124
_PyThreadStateImpl *tstate_impl = (_PyThreadStateImpl *)p;
125
total += _Py_atomic_load_ssize_relaxed(&tstate_impl->reftotal);
126
}
127
+ INTERP_HEAD_UNLOCK(interp);
128
#endif
129
return total;
130
0 commit comments