Skip to content

Commit 1afcbb7

Browse files
committed
Add clarification to 'only if'
1 parent 1b10658 commit 1afcbb7

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

Doc/c-api/init.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1339,8 +1339,8 @@ with sub-interpreters:
13391339
13401340
Return ``1`` if the current thread is holding the GIL and ``0`` otherwise.
13411341
This function can be called from any thread at any time.
1342-
Only if it has had its Python thread state initialized and currently is
1343-
holding the GIL will it return ``1``.
1342+
Only if it has had its Python thread state initialized via :c:func:`PyGILState_Ensure`
1343+
and currently is holding the GIL will it return ``1``.
13441344
This is mainly a helper/diagnostic function. It can be useful
13451345
for example in callback contexts or memory allocation functions when
13461346
knowing that the GIL is locked can allow the caller to perform sensitive

0 commit comments

Comments
 (0)