diff options
author | Sandro Tosi <sandro.tosi@gmail.com> | 2011-08-08 00:15:57 +0200 |
---|---|---|
committer | Sandro Tosi <sandro.tosi@gmail.com> | 2011-08-08 00:15:57 +0200 |
commit | 9943c0d5d7d2a5eb98f3614f24e8eab75db297ba (patch) | |
tree | d6676a2a01fb1341552f6d81a627725112189ee3 | |
parent | 1381a31e39ceb775585cacbd5e7f43e91a162786 (diff) | |
download | cpython-git-9943c0d5d7d2a5eb98f3614f24e8eab75db297ba.tar.gz |
#10741: add documentation for PyGILState_GetThisThreadState()
-rw-r--r-- | Doc/c-api/init.rst | 10 | ||||
-rw-r--r-- | Include/pystate.h | 2 |
2 files changed, 11 insertions, 1 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 9354e3c6da..996ab78d78 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -638,6 +638,16 @@ with sub-interpreters: .. versionadded:: 2.3 +.. 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 that the main thread + always has such a thread-state, even if no auto-thread-state call has been + made on the main thread. This is mainly a helper/diagnostic function. + + .. versionadded:: 2.3 + + The following macros are normally used without a trailing semicolon; look for example usage in the Python source distribution. diff --git a/Include/pystate.h b/Include/pystate.h index 729342ccbd..63371fac00 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -169,7 +169,7 @@ PyAPI_FUNC(void) PyGILState_Release(PyGILState_STATE); /* Helper/diagnostic function - 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 + on the current thread. Note that the main thread always has such a thread-state, even if no auto-thread-state call has been made on the main thread. */ |