diff options
author | Steve Dower <steve.dower@python.org> | 2022-11-17 00:24:16 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-17 00:24:16 (GMT) |
commit | 5fdd49dc653b4c14e3303c1eefd9d031602bbbf5 (patch) | |
tree | 65d5666b8c9ce47d2c4472631efd49d860456e6a /Python/pystate.c | |
parent | bc390dd93574c3c6773958c6a7e68adc83d0bf3f (diff) | |
download | cpython-5fdd49dc653b4c14e3303c1eefd9d031602bbbf5.zip cpython-5fdd49dc653b4c14e3303c1eefd9d031602bbbf5.tar.gz cpython-5fdd49dc653b4c14e3303c1eefd9d031602bbbf5.tar.bz2 |
gh-99377: Revert audit events for thread state creation and free, because the GIL is not properly held at these times (GH-99543)
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 19 |
1 files changed, 1 insertions, 18 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index a53a9a3..c7f2386 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -875,11 +875,6 @@ PyThreadState_New(PyInterpreterState *interp) PyThreadState *tstate = new_threadstate(interp); if (tstate) { _PyThreadState_SetCurrent(tstate); - if (PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0) { - PyThreadState_Clear(tstate); - _PyThreadState_DeleteCurrent(tstate); - return NULL; - } } return tstate; } @@ -887,15 +882,7 @@ PyThreadState_New(PyInterpreterState *interp) PyThreadState * _PyThreadState_Prealloc(PyInterpreterState *interp) { - PyThreadState *tstate = new_threadstate(interp); - if (tstate) { - if (PySys_Audit("cpython.PyThreadState_New", "K", tstate->id) < 0) { - PyThreadState_Clear(tstate); - _PyThreadState_Delete(tstate, 0); - return NULL; - } - } - return tstate; + return new_threadstate(interp); } // We keep this around for (accidental) stable ABI compatibility. @@ -1043,10 +1030,6 @@ _PyInterpreterState_ClearModules(PyInterpreterState *interp) void PyThreadState_Clear(PyThreadState *tstate) { - if (PySys_Audit("cpython.PyThreadState_Clear", "K", tstate->id) < 0) { - PyErr_WriteUnraisable(NULL); - } - int verbose = _PyInterpreterState_GetConfig(tstate->interp)->verbose; if (verbose && tstate->cframe->current_frame != NULL) { |