]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
[3.12] gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (GH-128662...
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Thu, 9 Jan 2025 09:26:40 +0000 (10:26 +0100)
committerGitHub <noreply@github.com>
Thu, 9 Jan 2025 09:26:40 +0000 (09:26 +0000)
gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (GH-128662)
(cherry picked from commit 4685401845ba3e2ab8c9f4a9a10aa2969b11985f)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Doc/library/asyncio-eventloop.rst

index 53aaae413027d40bb34448e343060fa2b1c3f302..8d26346c63018b81a5f1c7db593ae13ed350e179 100644 (file)
@@ -236,6 +236,9 @@ Scheduling callbacks
    another thread, this function *must* be used, since :meth:`call_soon` is not
    thread-safe.
 
+   This function is safe to be called from a reentrant context or signal handler,
+   however, it is not safe or fruitful to use the returned handle in such contexts.
+
    Raises :exc:`RuntimeError` if called on a loop that's been closed.
    This can happen on a secondary thread when the main application is
    shutting down.