]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
gh-141004: Document `Py_MakePendingCalls` (GH-141137)
authorPeter Bierma <zintensitydev@gmail.com>
Thu, 20 Nov 2025 13:42:01 +0000 (08:42 -0500)
committerGitHub <noreply@github.com>
Thu, 20 Nov 2025 13:42:01 +0000 (08:42 -0500)
Co-authored-by: Victor Stinner <vstinner@python.org>
Doc/c-api/init.rst

index 3cac2c8b213c80362d02edce98109f8f684e2f4c..4a841c9e3c8f9a34b9b6b33f4007b3d303fe03cc 100644 (file)
@@ -1891,6 +1891,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