diff options
author | Joannah Nanjekye <33177550+nanjekyejoannah@users.noreply.github.com> | 2019-10-04 11:35:42 (GMT) |
---|---|---|
committer | Victor Stinner <vstinner@python.org> | 2019-10-04 11:35:42 (GMT) |
commit | 8855e47d09d4db1206c65b24efc8ad0df585ac46 (patch) | |
tree | 7bad8536eb0439d6c6edfed703b7165cb367ca0b /Python/pystate.c | |
parent | 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6 (diff) | |
download | cpython-8855e47d09d4db1206c65b24efc8ad0df585ac46.zip cpython-8855e47d09d4db1206c65b24efc8ad0df585ac46.tar.gz cpython-8855e47d09d4db1206c65b24efc8ad0df585ac46.tar.bz2 |
bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal (GH-16558)
Revert the removal of PyThreadState_DeleteCurrent() with documentation.
Diffstat (limited to 'Python/pystate.c')
-rw-r--r-- | Python/pystate.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/Python/pystate.c b/Python/pystate.c index f3d89e7..b4b1247 100644 --- a/Python/pystate.c +++ b/Python/pystate.c @@ -801,7 +801,7 @@ PyThreadState_Clear(PyThreadState *tstate) } -/* Common code for PyThreadState_Delete() and _PyThreadState_DeleteCurrent() */ +/* Common code for PyThreadState_Delete() and PyThreadState_DeleteCurrent() */ static void tstate_delete_common(_PyRuntimeState *runtime, PyThreadState *tstate) { @@ -857,7 +857,7 @@ _PyThreadState_DeleteCurrent(_PyRuntimeState *runtime) PyThreadState *tstate = _PyRuntimeGILState_GetThreadState(gilstate); if (tstate == NULL) Py_FatalError( - "_PyThreadState_DeleteCurrent: no current tstate"); + "PyThreadState_DeleteCurrent: no current tstate"); tstate_delete_common(runtime, tstate); if (gilstate->autoInterpreterState && PyThread_tss_get(&gilstate->autoTSSkey) == tstate) @@ -868,6 +868,12 @@ _PyThreadState_DeleteCurrent(_PyRuntimeState *runtime) PyEval_ReleaseLock(); } +void +PyThreadState_DeleteCurrent(void) +{ + _PyThreadState_DeleteCurrent(&_PyRuntime); +} + /* * Delete all thread states except the one passed as argument. |