Skip to content

Commit d573053

Browse files
Call _PyThreadState_GET() from _PyRuntimeState_GetThreadState().
1 parent 3db4007 commit d573053

File tree

1 file changed

+11
-11
lines changed

1 file changed

+11
-11
lines changed

Include/internal/pycore_pystate.h

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -69,8 +69,15 @@ extern _Py_thread_local PyThreadState *_Py_tss_tstate;
6969
#endif
7070
PyAPI_DATA(PyThreadState *) _PyThreadState_GetCurrent(void);
7171

72+
/* Get the current Python thread state.
73+
74+
This function is unsafe: it does not check for error and it can return NULL.
75+
76+
The caller must hold the GIL.
77+
78+
See also PyThreadState_Get() and _PyThreadState_UncheckedGet(). */
7279
static inline PyThreadState*
73-
_PyRuntimeState_GetThreadState(_PyRuntimeState *runtime)
80+
_PyThreadState_GET(void)
7481
{
7582
#if defined(HAVE_THREAD_LOCAL) && !defined(Py_BUILD_CORE_MODULE)
7683
return _Py_tss_tstate;
@@ -79,20 +86,13 @@ _PyRuntimeState_GetThreadState(_PyRuntimeState *runtime)
7986
#endif
8087
}
8188

82-
83-
/* Get the current Python thread state.
84-
85-
This function is unsafe: it does not check for error and it can return NULL.
86-
87-
The caller must hold the GIL.
88-
89-
See also PyThreadState_Get() and _PyThreadState_UncheckedGet(). */
9089
static inline PyThreadState*
91-
_PyThreadState_GET(void)
90+
_PyRuntimeState_GetThreadState(_PyRuntimeState *Py_UNUSED(runtime))
9291
{
93-
return _PyRuntimeState_GetThreadState(&_PyRuntime);
92+
return _PyThreadState_GET();
9493
}
9594

95+
9696
static inline void
9797
_Py_EnsureFuncTstateNotNULL(const char *func, PyThreadState *tstate)
9898
{

0 commit comments

Comments
 (0)