@@ -1190,9 +1190,10 @@ call_instrumentation_vector(
1190
1190
break ;
1191
1191
}
1192
1192
else {
1193
- LOCK_CODE (code );
1193
+ PyInterpreterState * interp = tstate -> interp ;
1194
+ _PyEval_StopTheWorld (interp );
1194
1195
remove_tools (code , offset , event , 1 << tool );
1195
- UNLOCK_CODE ( );
1196
+ _PyEval_StartTheWorld ( interp );
1196
1197
}
1197
1198
}
1198
1199
}
@@ -1381,9 +1382,10 @@ _Py_call_instrumentation_line(PyThreadState *tstate, _PyInterpreterFrame* frame,
1381
1382
}
1382
1383
else {
1383
1384
/* DISABLE */
1384
- LOCK_CODE (code );
1385
+ PyInterpreterState * interp = tstate -> interp ;
1386
+ _PyEval_StopTheWorld (interp );
1385
1387
remove_line_tools (code , i , 1 << tool );
1386
- UNLOCK_CODE ( );
1388
+ _PyEval_StartTheWorld ( interp );
1387
1389
}
1388
1390
} while (tools );
1389
1391
Py_DECREF (line_obj );
@@ -1438,9 +1440,10 @@ _Py_call_instrumentation_instruction(PyThreadState *tstate, _PyInterpreterFrame*
1438
1440
}
1439
1441
else {
1440
1442
/* DISABLE */
1441
- LOCK_CODE (code );
1443
+ PyInterpreterState * interp = tstate -> interp ;
1444
+ _PyEval_StopTheWorld (interp );
1442
1445
remove_per_instruction_tools (code , offset , 1 << tool );
1443
- UNLOCK_CODE ( );
1446
+ _PyEval_StartTheWorld ( interp );
1444
1447
}
1445
1448
}
1446
1449
Py_DECREF (offset_obj );
@@ -2995,9 +2998,10 @@ branch_handler_vectorcall(
2995
2998
// Orphaned NOT_TAKEN -- Jump removed by the compiler
2996
2999
return res ;
2997
3000
}
2998
- LOCK_CODE (code );
3001
+ PyInterpreterState * interp = _PyInterpreterState_GET ();
3002
+ _PyEval_StopTheWorld (interp );
2999
3003
remove_tools (code , offset , other_event , 1 << self -> tool_id );
3000
- UNLOCK_CODE ( );
3004
+ _PyEval_StartTheWorld ( interp );
3001
3005
}
3002
3006
return res ;
3003
3007
}
0 commit comments