diff options
author | Sandro Tosi <sandro.tosi@gmail.com> | 2011-08-07 22:16:54 (GMT) |
---|---|---|
committer | Sandro Tosi <sandro.tosi@gmail.com> | 2011-08-07 22:16:54 (GMT) |
commit | 61baee0ee7c5183c80809e9b44da2542c682c235 (patch) | |
tree | d00caf98ed8f3300407472611263be8e5161d67b | |
parent | 2a389e4601a462a028fb34991704a1f92d51d0ee (diff) | |
download | cpython-61baee0ee7c5183c80809e9b44da2542c682c235.zip cpython-61baee0ee7c5183c80809e9b44da2542c682c235.tar.gz cpython-61baee0ee7c5183c80809e9b44da2542c682c235.tar.bz2 |
#10741: add documentation for PyGILState_GetThisThreadState()
-rw-r--r-- | Doc/c-api/init.rst | 8 | ||||
-rw-r--r-- | Include/pystate.h | 2 |
2 files changed, 9 insertions, 1 deletions
diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 1806867..4b70ec2 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -646,6 +646,14 @@ with sub-interpreters: :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 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. + + 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 5d2ee63..b5fe1ad 100644 --- a/Include/pystate.h +++ b/Include/pystate.h @@ -195,7 +195,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. */ |