Skip to content

Commit b947bc9

Browse files
committed
Rollback to unmodified
1 parent 7bf9a1c commit b947bc9

File tree

1 file changed

+10
-12
lines changed

1 file changed

+10
-12
lines changed

Python/ceval.c

Lines changed: 10 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2378,17 +2378,16 @@ PyEval_SetProfileAllThreads(Py_tracefunc func, PyObject *arg)
23782378
PyThreadState *this_tstate = _PyThreadState_GET();
23792379
PyInterpreterState *interp = this_tstate->interp;
23802380

2381-
INTERP_HEAD_LOCK(interp);
2382-
PyThreadState* ts = PyInterpreterState_ThreadHead(interp);
2383-
INTERP_HEAD_UNLOCK(interp);
2384-
2381+
HEAD_LOCK(&_PyRuntime);
2382+
PyThreadState *ts = PyInterpreterState_ThreadHead(interp);
2383+
HEAD_UNLOCK(&_PyRuntime);
23852384
while (ts) {
23862385
if (_PyEval_SetProfile(ts, func, arg) < 0) {
23872386
PyErr_FormatUnraisable("Exception ignored in PyEval_SetProfileAllThreads");
23882387
}
2389-
INTERP_HEAD_LOCK(interp);
2388+
HEAD_LOCK(&_PyRuntime);
23902389
ts = PyThreadState_Next(ts);
2391-
INTERP_HEAD_UNLOCK(interp);
2390+
HEAD_UNLOCK(&_PyRuntime);
23922391
}
23932392
}
23942393

@@ -2408,17 +2407,16 @@ PyEval_SetTraceAllThreads(Py_tracefunc func, PyObject *arg)
24082407
PyThreadState *this_tstate = _PyThreadState_GET();
24092408
PyInterpreterState *interp = this_tstate->interp;
24102409

2411-
INTERP_HEAD_LOCK(interp);
2412-
PyThreadState* ts = PyInterpreterState_ThreadHead(interp);
2413-
INTERP_HEAD_UNLOCK(interp);
2414-
2410+
HEAD_LOCK(&_PyRuntime);
2411+
PyThreadState *ts = PyInterpreterState_ThreadHead(interp);
2412+
HEAD_UNLOCK(&_PyRuntime);
24152413
while (ts) {
24162414
if (_PyEval_SetTrace(ts, func, arg) < 0) {
24172415
PyErr_FormatUnraisable("Exception ignored in PyEval_SetTraceAllThreads");
24182416
}
2419-
INTERP_HEAD_LOCK(interp);
2417+
HEAD_LOCK(&_PyRuntime);
24202418
ts = PyThreadState_Next(ts);
2421-
INTERP_HEAD_UNLOCK(interp);
2419+
HEAD_UNLOCK(&_PyRuntime);
24222420
}
24232421
}
24242422

0 commit comments

Comments
 (0)