mirror of
https://github.com/python/cpython.git
synced 2025-11-25 04:34:37 +00:00
gh-103323: Remove PyRuntimeState_GetThreadState() (#104171)
This function no longer makes sense, since its runtime parameter is no longer used. Use directly _PyThreadState_GET() and _PyInterpreterState_GET() instead.
This commit is contained in:
parent
eba64d2afb
commit
45398ad512
5 changed files with 9 additions and 17 deletions
|
|
@ -546,8 +546,7 @@ _PyEval_Fini(void)
|
|||
void
|
||||
PyEval_AcquireLock(void)
|
||||
{
|
||||
_PyRuntimeState *runtime = &_PyRuntime;
|
||||
PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
_Py_EnsureTstateNotNULL(tstate);
|
||||
|
||||
take_gil(tstate);
|
||||
|
|
@ -557,7 +556,7 @@ void
|
|||
PyEval_ReleaseLock(void)
|
||||
{
|
||||
_PyRuntimeState *runtime = &_PyRuntime;
|
||||
PyThreadState *tstate = _PyRuntimeState_GetThreadState(runtime);
|
||||
PyThreadState *tstate = _PyThreadState_GET();
|
||||
/* This function must succeed when the current thread state is NULL.
|
||||
We therefore avoid PyThreadState_Get() which dumps a fatal error
|
||||
in debug mode. */
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue