diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -646,6 +646,15 @@ :c:func:`PyGILState_Release` on the same thread. +.. c:function:: PyThreadState PyGILState_GetThisThreadState() + + Get the current thread state for this thread. May return ``NULL`` if no + GILState API has been used on the current thread. Note the main thread + always has such a thread-state, even if no auto-thread-state call has been + made on the main thread. The purpose of this function is mainly a + helper/diagnostic tool. + + The following macros are normally used without a trailing semicolon; look for example usage in the Python source distribution.