From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Tue, 17 Aug 2021 23:18:22 +0000 (-0700) Subject: bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) ... X-Git-Tag: v3.9.7~46 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e2320c6a34d44a0efa7ecc693c3a6215014b7b6e;p=thirdparty%2FPython%2Fcpython.git bpo-44508: [Doc] Document failure mode for loop.call_soon_threadsafe (GH-27688) (GH-27805) Co-authored-by: Ɓukasz Langa (cherry picked from commit 3240bc62f4e0afa09964f3afc845697f0a0806b9) Co-authored-by: meowmeowmeowcat --- diff --git a/Doc/library/asyncio-eventloop.rst b/Doc/library/asyncio-eventloop.rst index 66eb3faecd89..4a64475f2a93 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.