@@ -96,7 +96,7 @@ the thread:
9696
9797Unfortunately, this isn't correct, because of time-of-call to time-of-use
9898issues; the interpreter might not be finalizing during the call to
99- :c:func: `Py_IsFinalizing `, but it might start finalizing right after , which
99+ :c:func: `Py_IsFinalizing `, but it might start finalizing immediately afterwards , which
100100would cause the attachment of a thread state (typically via
101101:c:func: `PyGILState_Ensure `) to hang the thread.
102102
@@ -155,14 +155,14 @@ The existing APIs are broken and misleading
155155-------------------------------------------
156156
157157There are currently two public ways for a user to create and attach their own
158- :term: `thread state `; manual use of :c:func: `PyThreadState_New ` / :c:func: `PyThreadState_Swap `,
159- and :c:func: `PyGILState_Ensure `. The former , :c:func: `PyGILState_Ensure `,
158+ :term: `thread state `; manual use of :c:func: `PyThreadState_New ` & :c:func: `PyThreadState_Swap `,
159+ and :c:func: `PyGILState_Ensure `. The latter , :c:func: `PyGILState_Ensure `,
160160is `significantly more common <https://grep.app/search?q=pygilstate_ensure >`_.
161161
162162:c:func: `PyGILState_Ensure ` generally crashes during finalization
163163*****************************************************************
164164
165- As of this PEP , the current behavior of :c:func: `PyGILState_Ensure ` does not
165+ At the time of writing , the current behavior of :c:func: `PyGILState_Ensure ` does not
166166match the documentation. Instead of hanging the thread during finalization
167167as previously noted, it's extremely common for it to crash with a segmentation
168168fault. This is a `known issue <https://github.com/python/cpython/issues/124619 >`_
0 commit comments