diff --git a/Doc/c-api/init.rst b/Doc/c-api/init.rst index 49ffeab55850c0..802aa8e3837e5e 100644 --- a/Doc/c-api/init.rst +++ b/Doc/c-api/init.rst @@ -1854,6 +1854,24 @@ 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. If this is not called in the main thread of the main + interpreter, this function does nothing and returns ``0``. + + This function returns ``0`` on success, and returns ``-1`` with an exception + set on failure. + + 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