mirror of
https://github.com/python/cpython.git
synced 2025-08-27 12:16:04 +00:00
[3.13] gh-117657: Fix some simple races in instrumentation.c (GH-120118) (#120444)
gh-117657: Fix some simple races in instrumentation.c (GH-120118)
* stop the world when setting local events
(cherry picked from commit b1b61dc4ce
)
Co-authored-by: Ken Jin <kenjin@python.org>
This commit is contained in:
parent
3067c62a34
commit
17188270b6
1 changed files with 2 additions and 2 deletions
|
@ -1977,7 +1977,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
|
|||
}
|
||||
|
||||
int res;
|
||||
LOCK_CODE(code);
|
||||
_PyEval_StopTheWorld(interp);
|
||||
if (allocate_instrumentation_data(code)) {
|
||||
res = -1;
|
||||
goto done;
|
||||
|
@ -1994,7 +1994,7 @@ _PyMonitoring_SetLocalEvents(PyCodeObject *code, int tool_id, _PyMonitoringEvent
|
|||
res = force_instrument_lock_held(code, interp);
|
||||
|
||||
done:
|
||||
UNLOCK_CODE();
|
||||
_PyEval_StartTheWorld(interp);
|
||||
return res;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue