From b53f61a3050e380ca1936671c5e11aedbbb7eb7c Mon Sep 17 00:00:00 2001 From: meowmeowmeowcat Date: Wed, 18 Aug 2021 06:55:04 +0800 Subject: [PATCH] bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: Ɓukasz Langa (cherry picked from commit 3240bc62f4e0afa09964f3afc845697f0a0806b9) Co-authored-by: meowmeowmeowcat --- Doc/library/asyncio-eventloop.rst | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 66eb3faecd896e..4a64475f2a939e 100644 --- a/Doc/library/asyncio-eventloop.rst +++ b/Doc/library/asyncio-eventloop.rst @@ -211,6 +211,10 @@ Scheduling callbacks A thread-safe variant of :meth:`call_soon`. Must be used to schedule callbacks *from another thread*. + 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. + See the :ref:`concurrency and multithreading ` section of the documentation.