Skip to content

Commit e05a127

Browse files
committed
improve comments.
1 parent afe5507 commit e05a127

File tree

1 file changed

+6
-5
lines changed

1 file changed

+6
-5
lines changed

Python/ceval_gil.c

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -278,6 +278,7 @@ drop_gil(PyInterpreterState *interp, PyThreadState *tstate, int final_release)
278278
/* Take the GIL.
279279
280280
The function saves errno at entry and restores its value at exit.
281+
It may hang rather than return if the interpreter has been finalized.
281282
282283
tstate must be non-NULL. */
283284
static void
@@ -298,11 +299,11 @@ take_gil(PyThreadState *tstate)
298299
completes. In this case, tstate is a dangling pointer: points to
299300
PyThreadState freed memory.
300301
301-
This used to call a *thread_exit API, but that was not safe as it
302-
lacks stack unwinding and local variable destruction important to
303-
C++. gh-87135: The best that can be done is to hang the thread as
304-
the public APIs calling this have no error reporting mechanism (!).
305-
*/
302+
This used to call a *thread_exit API, but that was not safe as it
303+
lacks stack unwinding and local variable destruction important to
304+
C++. gh-87135: The best that can be done is to hang the thread as
305+
the public APIs calling this have no error reporting mechanism (!).
306+
*/
306307
PyThread_hang_thread();
307308
}
308309

0 commit comments

Comments
 (0)