aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/Python/ceval_gil.c
diff options
context:
space:
mode:
Diffstat (limited to 'Python/ceval_gil.c')
-rw-r--r--Python/ceval_gil.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/Python/ceval_gil.c b/Python/ceval_gil.c
index 4c9f59f837e..1f811e72406 100644
--- a/Python/ceval_gil.c
+++ b/Python/ceval_gil.c
@@ -977,25 +977,19 @@ make_pending_calls(PyThreadState *tstate)
void
_Py_set_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit)
{
- _PyRuntimeState *runtime = &_PyRuntime;
-
- HEAD_LOCK(runtime);
- for (PyThreadState *tstate = interp->threads.head; tstate != NULL; tstate = tstate->next) {
+ _Py_FOR_EACH_TSTATE_BEGIN(interp, tstate) {
_Py_set_eval_breaker_bit(tstate, bit);
}
- HEAD_UNLOCK(runtime);
+ _Py_FOR_EACH_TSTATE_END(interp);
}
void
_Py_unset_eval_breaker_bit_all(PyInterpreterState *interp, uintptr_t bit)
{
- _PyRuntimeState *runtime = &_PyRuntime;
-
- HEAD_LOCK(runtime);
- for (PyThreadState *tstate = interp->threads.head; tstate != NULL; tstate = tstate->next) {
+ _Py_FOR_EACH_TSTATE_BEGIN(interp, tstate) {
_Py_unset_eval_breaker_bit(tstate, bit);
}
- HEAD_UNLOCK(runtime);
+ _Py_FOR_EACH_TSTATE_END(interp);
}
void