From dd061a19daa8683ca400904c30ff901fe88588f9 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Thu, 9 Jan 2025 09:02:51 +0000 Subject: [PATCH 1/3] improve docs --- Doc/library/asyncio-eventloop.rst | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index ccb362d8c31ddf..8959fb774c5248 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -246,6 +246,8 @@ 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 re-entrant context or signal handler. + 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. From 4d0006a776bafdcbf81c8e72d2c4896bc34c95ea Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Thu, 9 Jan 2025 14:37:46 +0530 Subject: [PATCH 2/3] Update Doc/library/asyncio-eventloop.rst Co-authored-by: Thomas Grainger --- Doc/library/asyncio-eventloop.rst | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 8959fb774c5248..bf2d4f9ead94c6 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -246,7 +246,8 @@ 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 re-entrant context or signal handler. + This function is safe to be called from a re-entrant 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 From 1bb1f34d40f20bfaacd95b94c73e1db0c36f23b4 Mon Sep 17 00:00:00 2001 From: Kumar Aditya Date: Thu, 9 Jan 2025 09:13:38 +0000 Subject: [PATCH 3/3] use reentrant --- Doc/library/asyncio-eventloop.rst | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index bf2d4f9ead94c6..bfc0d16f023e5e 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -246,7 +246,7 @@ 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 re-entrant context or signal handler, + 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.