From 4f01a120f768d567f6b238f89f13dc349b0a17ed Mon Sep 17 00:00:00 2001 From: "Miss Islington (bot)" <31488909+miss-islington@users.noreply.github.com> Date: Thu, 9 Jan 2025 10:25:18 +0100 Subject: [PATCH] [3.13] gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (GH-128662) (#128664) gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (GH-128662) (cherry picked from commit 4685401845ba3e2ab8c9f4a9a10aa2969b11985f) Co-authored-by: Kumar Aditya Co-authored-by: Thomas Grainger --- Doc/library/asyncio-eventloop.rst | 3 +++ 1 file changed, 3 insertions(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 8d7d0377c132..586623b5a78b 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -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. -- 2.47.3