@@ -2378,17 +2378,16 @@ PyEval_SetProfileAllThreads(Py_tracefunc func, PyObject *arg)
2378
2378
PyThreadState * this_tstate = _PyThreadState_GET ();
2379
2379
PyInterpreterState * interp = this_tstate -> interp ;
2380
2380
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 );
2385
2384
while (ts ) {
2386
2385
if (_PyEval_SetProfile (ts , func , arg ) < 0 ) {
2387
2386
PyErr_FormatUnraisable ("Exception ignored in PyEval_SetProfileAllThreads" );
2388
2387
}
2389
- INTERP_HEAD_LOCK ( interp );
2388
+ HEAD_LOCK ( & _PyRuntime );
2390
2389
ts = PyThreadState_Next (ts );
2391
- INTERP_HEAD_UNLOCK ( interp );
2390
+ HEAD_UNLOCK ( & _PyRuntime );
2392
2391
}
2393
2392
}
2394
2393
@@ -2408,17 +2407,16 @@ PyEval_SetTraceAllThreads(Py_tracefunc func, PyObject *arg)
2408
2407
PyThreadState * this_tstate = _PyThreadState_GET ();
2409
2408
PyInterpreterState * interp = this_tstate -> interp ;
2410
2409
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 );
2415
2413
while (ts ) {
2416
2414
if (_PyEval_SetTrace (ts , func , arg ) < 0 ) {
2417
2415
PyErr_FormatUnraisable ("Exception ignored in PyEval_SetTraceAllThreads" );
2418
2416
}
2419
- INTERP_HEAD_LOCK ( interp );
2417
+ HEAD_LOCK ( & _PyRuntime );
2420
2418
ts = PyThreadState_Next (ts );
2421
- INTERP_HEAD_UNLOCK ( interp );
2419
+ HEAD_UNLOCK ( & _PyRuntime );
2422
2420
}
2423
2421
}
2424
2422
0 commit comments