mirror of
https://github.com/python/cpython.git
synced 2025-07-09 20:35:26 +00:00
bpo-37878: Remove PyThreadState_DeleteCurrent() function (GH-15315)
* Rename PyThreadState_DeleteCurrent() to _PyThreadState_DeleteCurrent() * Move it to the internal C API Co-Authored-By: Carol Willing <carolcode@willingconsulting.com>
This commit is contained in:
parent
2c2b561967
commit
2bc43cdc01
7 changed files with 18 additions and 14 deletions
|
@ -809,7 +809,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)
|
||||
{
|
||||
|
@ -858,14 +858,14 @@ PyThreadState_Delete(PyThreadState *tstate)
|
|||
}
|
||||
|
||||
|
||||
static void
|
||||
void
|
||||
_PyThreadState_DeleteCurrent(_PyRuntimeState *runtime)
|
||||
{
|
||||
struct _gilstate_runtime_state *gilstate = &runtime->gilstate;
|
||||
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)
|
||||
|
@ -876,12 +876,6 @@ _PyThreadState_DeleteCurrent(_PyRuntimeState *runtime)
|
|||
PyEval_ReleaseLock();
|
||||
}
|
||||
|
||||
void
|
||||
PyThreadState_DeleteCurrent()
|
||||
{
|
||||
_PyThreadState_DeleteCurrent(&_PyRuntime);
|
||||
}
|
||||
|
||||
|
||||
/*
|
||||
* Delete all thread states except the one passed as argument.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue