Skip to content

Commit d12bd1b

Browse files
[3.13] pythongh-101100: Fix reference warnings in c-api/init.rst document… (python#139833)
Co-authored-by: Stan Ulbrych <[email protected]>
1 parent abe6f52 commit d12bd1b

File tree

2 files changed

+16
-4
lines changed

2 files changed

+16
-4
lines changed

Doc/c-api/init.rst

Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1094,7 +1094,7 @@ acquire the :term:`GIL`.
10941094
If any thread, other than the finalization thread, attempts to acquire the GIL
10951095
during finalization, either explicitly via :c:func:`PyGILState_Ensure`,
10961096
:c:macro:`Py_END_ALLOW_THREADS`, :c:func:`PyEval_AcquireThread`, or
1097-
:c:func:`PyEval_AcquireLock`, or implicitly when the interpreter attempts to
1097+
:c:func:`!PyEval_AcquireLock`, or implicitly when the interpreter attempts to
10981098
reacquire it after having yielded it, the thread enters **a permanently blocked
10991099
state** where it remains until the program exits. In most cases this is
11001100
harmless, but this can result in deadlock if a later stage of finalization
@@ -1228,6 +1228,19 @@ code, or when embedding the Python interpreter:
12281228
The following functions use thread-local storage, and are not compatible
12291229
with sub-interpreters:
12301230
1231+
.. c:type:: PyGILState_STATE
1232+
1233+
The type of the value returned by :c:func:`PyGILState_Ensure` and passed to
1234+
:c:func:`PyGILState_Release`.
1235+
1236+
.. c:enumerator:: PyGILState_LOCKED
1237+
1238+
The GIL was already held when :c:func:`PyGILState_Ensure` was called.
1239+
1240+
.. c:enumerator:: PyGILState_UNLOCKED
1241+
1242+
The GIL was not held when :c:func:`PyGILState_Ensure` was called.
1243+
12311244
.. c:function:: PyGILState_STATE PyGILState_Ensure()
12321245
12331246
Ensure that the current thread is ready to call the Python C API regardless
@@ -1372,11 +1385,11 @@ All of the following functions must be called after :c:func:`Py_Initialize`.
13721385
must be held.
13731386
13741387
.. versionchanged:: 3.9
1375-
This function now calls the :c:member:`PyThreadState.on_delete` callback.
1388+
This function now calls the :c:member:`!PyThreadState.on_delete` callback.
13761389
Previously, that happened in :c:func:`PyThreadState_Delete`.
13771390
13781391
.. versionchanged:: 3.13
1379-
The :c:member:`PyThreadState.on_delete` callback was removed.
1392+
The :c:member:`!PyThreadState.on_delete` callback was removed.
13801393
13811394
13821395
.. c:function:: void PyThreadState_Delete(PyThreadState *tstate)

Doc/tools/.nitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44

55
Doc/c-api/descriptor.rst
66
Doc/c-api/float.rst
7-
Doc/c-api/init.rst
87
Doc/c-api/init_config.rst
98
Doc/c-api/intro.rst
109
Doc/c-api/module.rst

0 commit comments

Comments
 (0)