mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-38266: Revert bpo-37878: Make PyThreadState_DeleteCurrent() Internal (GH-16558)
Revert the removal of PyThreadState_DeleteCurrent() with documentation.
This commit is contained in:
parent
06cb94bc84
commit
8855e47d09
4 changed files with 18 additions and 2 deletions
|
@ -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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue