8000 [3.13] gh-87135: Hang non-main threads that attempt to acquire the GIL during finalization (GH-105805) by gpshead · Pull Request #137827 · python/cpython · GitHub
[go: up one dir, main page]

Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
fix Py_IsFinalizing doc ref
  • Loading branch information
gpshead committed Aug 16, 2025
commit d24d14e48a08c54732ceeebd9f75a2accb5a8252
2 changes: 1 addition & 1 deletion Doc/c-api/init.rst
Original file line number Diff line number Diff line change
Expand Up @@ -1086,12 +1086,12 @@
In the late stage of :term:`interpreter shutdown`, after attempting to wait for
non-daemon threads to exit (though this can be interrupted by
:class:`KeyboardInterrupt`) and running the :mod:`atexit` functions, the runtime
is marked as *finalizing*: :c:func:`_Py_IsFinalizing` and
is marked as *finalizing*: :c:func:`Py_IsFinalizing` and
:func:`sys.is_finalizing` return true. At this point, only the *finalization
thread* that initiated finalization (typically the main thread) is allowed to
acquire the :term:`GIL`.

If any thread, other than the finalization thread, attempts to acquire the GIL

Check warning on line 1094 in Doc/c-api/init.rst

View workflow job for this annotation

GitHub Actions / Docs / Docs

c:func reference target not found: PyEval_AcquireLock [ref.func]
during finalization, either explicitly via :c:func:`PyGILState_Ensure`,
:c:macro:`Py_END_ALLOW_THREADS`, :c:func:`PyEval_AcquireThread`, or
:c:func:`PyEval_AcquireLock`, or implicitly when the interpreter attempts to
Expand Down
Loading
0