]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.14] gh-141004: Document `Py_MakePendingCalls` (GH-141137) (GH-141787)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 20 Nov 2025 13:48:11 +0000 (14:48 +0100)
committerGitHub <noreply@github.com>
Thu, 20 Nov 2025 13:48:11 +0000 (13:48 +0000)
gh-141004: Document `Py_MakePendingCalls` (GH-141137)
(cherry picked from commit ce701032a3d5d3597466d5836ebe989db6eda2aa)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Doc/c-api/init.rst

index 660ab3c3cf97ac8482ad1bdcb6dd79fe0f11b4a9..b53fce8c727ade131956bc75cbd9d3d3ec4b28ba 100644 (file)
@@ -2019,6 +2019,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 an :term:`attached thread state`.
+
+   .. versionadded:: 3.1
+
+   .. versionchanged:: 3.12
+      This function only runs pending calls in the main interpreter.
+
+
 .. _profiling:
 
 Profiling and Tracing