diff options
author | Ken Jin <kenjin@python.org> | 2024-06-13 09:31:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-06-13 09:31:21 (GMT) |
commit | b1b61dc4cee43920ef2b08d5ac94ddf08119c507 (patch) | |
tree | 90c67b6062c3e9d2db5c44aef544571217421fdc /Python | |
parent | eebae2c460dabdc70dc0d9b6e189368eb1abb716 (diff) | |
download | cpython-b1b61dc4cee43920ef2b08d5ac94ddf08119c507.zip cpython-b1b61dc4cee43920ef2b08d5ac94ddf08119c507.tar.gz cpython-b1b61dc4cee43920ef2b08d5ac94ddf08119c507.tar.bz2 |
gh-117657: Fix some simple races in instrumentation.c (GH-120118)
* stop the world when setting local events
Diffstat (limited to 'Python')
-rw-r--r-- | Python/instrumentation.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Python/instrumentation.c b/Python/instrumentation.c index a5211ee..ae790a1 100644 --- a/Python/instrumentation.c +++ b/Python/instrumentation.c @@ -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; } |