mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
gh-127791: Fix, document, and test PyUnstable_AtExit
(#127793)
This commit is contained in:
parent
2cdeb61b57
commit
d5d84c3f13
7 changed files with 71 additions and 39 deletions
|
@ -567,6 +567,15 @@ Initializing and finalizing the interpreter
|
|||
customized Python that always runs in isolated mode using
|
||||
:c:func:`Py_RunMain`.
|
||||
|
||||
.. c:function:: int PyUnstable_AtExit(PyInterpreterState *interp, void (*func)(void *), void *data)
|
||||
|
||||
Register an :mod:`atexit` callback for the target interpreter *interp*.
|
||||
This is similar to :c:func:`Py_AtExit`, but takes an explicit interpreter and
|
||||
data pointer for the callback.
|
||||
|
||||
The :term:`GIL` must be held for *interp*.
|
||||
|
||||
.. versionadded:: 3.13
|
||||
|
||||
Process-wide parameters
|
||||
=======================
|
||||
|
|
|
@ -426,3 +426,7 @@ Process Control
|
|||
function registered last is called first. Each cleanup function will be called
|
||||
at most once. Since Python's internal finalization will have completed before
|
||||
the cleanup function, no Python APIs should be called by *func*.
|
||||
|
||||
.. seealso::
|
||||
|
||||
:c:func:`PyUnstable_AtExit` for passing a ``void *data`` argument.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue