Skip to content

Commit ce70103

Browse files
gh-141004: Document Py_MakePendingCalls (GH-141137)
Co-authored-by: Victor Stinner <vstinner@python.org>
1 parent 41b9ad5 commit ce70103

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

Doc/c-api/init.rst

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1891,6 +1891,25 @@ pointer and a void pointer argument.
18911891
This function now always schedules *func* to be run in the main
18921892
interpreter.
18931893
1894+
1895+
.. c:function:: int Py_MakePendingCalls(void)
1896+
1897+
Execute all pending calls. This is usually executed automatically by the
1898+
interpreter.
1899+
1900+
This function returns ``0`` on success, and returns ``-1`` with an exception
1901+
set on failure.
1902+
1903+
If this is not called in the main thread of the main
1904+
interpreter, this function does nothing and returns ``0``.
1905+
The caller must hold an :term:`attached thread state`.
1906+
1907+
.. versionadded:: 3.1
1908+
1909+
.. versionchanged:: 3.12
1910+
This function only runs pending calls in the main interpreter.
1911+
1912+
18941913
.. _profiling:
18951914
18961915
Profiling and Tracing

0 commit comments

Comments
 (0)