Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 61baee0

Browse files
committed
#10741: add documentation for PyGILState_GetThisThreadState()
1 parent 2a389e4 commit 61baee0

2 files changed

Lines changed: 9 additions & 1 deletion

File tree

Doc/c-api/init.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -646,6 +646,14 @@ with sub-interpreters:
646646
:c:func:`PyGILState_Release` on the same thread.
647647
648648
649+
.. c:function:: PyThreadState PyGILState_GetThisThreadState()
650+
651+
Get the current thread state for this thread. May return ``NULL`` if no
652+
GILState API has been used on the current thread. Note that the main thread
653+
always has such a thread-state, even if no auto-thread-state call has been
654+
made on the main thread. This is mainly a helper/diagnostic function.
655+
656+
649657
The following macros are normally used without a trailing semicolon; look for
650658
example usage in the Python source distribution.
651659

Include/pystate.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -195,7 +195,7 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE);
195195

196196
/* Helper/diagnostic function - get the current thread state for
197197
this thread. May return NULL if no GILState API has been used
198-
on the current thread. Note the main thread always has such a
198+
on the current thread. Note that the main thread always has such a
199199
thread-state, even if no auto-thread-state call has been made
200200
on the main thread.
201201
*/

0 commit comments

Comments
 (0)