Skip to content

Commit 5c44391

Browse files
committed
Change some usage of 'global interpreter lock'
1 parent f2826c4 commit 5c44391

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

Doc/c-api/init.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1262,7 +1262,7 @@ with sub-interpreters:
12621262
.. c:function:: PyGILState_STATE PyGILState_Ensure()
12631263
12641264
Ensure that the current thread is ready to call the Python C API regardless
1265-
of the current state of Python, or of the global interpreter lock.This may
1265+
of the current state of Python, or of the :term:`current thread state`. This may
12661266
be called as many times as desired by a thread as long as each call is
12671267
matched with a call to :c:func:`PyGILState_Release`. In general, other
12681268
thread-related APIs may be used between :c:func:`PyGILState_Ensure` and
@@ -1924,16 +1924,16 @@ pointer and a void pointer argument.
19241924
both these conditions met:
19251925
19261926
* on a :term:`bytecode` boundary;
1927-
* with the main thread holding the :term:`global interpreter lock`
1927+
* with the main thread holding an :term:`attached thread state`
19281928
(*func* can therefore use the full C API).
19291929
19301930
*func* must return ``0`` on success, or ``-1`` on failure with an exception
19311931
set. *func* won't be interrupted to perform another asynchronous
19321932
notification recursively, but it can still be interrupted to switch
1933-
threads if the global interpreter lock is released.
1933+
threads if the :term:`thread state <attached thread state>` is detached.
19341934
19351935
This function doesn't need a current thread state to run, and it doesn't
1936-
need the global interpreter lock.
1936+
need an :term:`attached thread state`.
19371937
19381938
To call this function in a subinterpreter, the caller must have an
19391939
:term:`attached thread state`. Otherwise, the function *func* can be scheduled to

Doc/glossary.rst

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -649,9 +649,9 @@ Glossary
649649
multi-threaded applications and makes it easier to use multi-core CPUs
650650
efficiently. For more details, see :pep:`703`.
651651

652-
In Python's C API, a function might declare that it requires (or doesn't require)
653-
the GIL to be held in order to use it. This refers to having an active
654-
:term:`thread state` for the current thread.
652+
In prior versions of Python's C API, a function might declare that it
653+
requires the GIL to be held in order to use it. This refers to having an
654+
:term:`attached thread state`.
655655

656656
hash-based pyc
657657
A bytecode cache file that uses the hash rather than the last-modified

0 commit comments

Comments
 (0)