[3.13] gh-141004: Document Py_MakePendingCalls (GH-141137) (GH-141788)

gh-141004: Document `Py_MakePendingCalls` (GH-141137)
(cherry picked from commit ce701032a3)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
This commit is contained in:
Miss Islington (bot) 2025-11-20 15:30:51 +01:00 committed by GitHub
parent 7a27c7b2e4
commit 79e0f6f684
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1964,6 +1964,25 @@ pointer and a void pointer argument.
This function now always schedules *func* to be run in the main
interpreter.
.. c:function:: int Py_MakePendingCalls(void)
Execute all pending calls. This is usually executed automatically by the
interpreter.
This function returns ``0`` on success, and returns ``-1`` with an exception
set on failure.
If this is not called in the main thread of the main
interpreter, this function does nothing and returns ``0``.
The caller must hold the :term:`GIL`.
.. versionadded:: 3.1
.. versionchanged:: 3.12
This function only runs pending calls in the main interpreter.
.. _profiling:
Profiling and Tracing