10000 gh-79149: document reentrant safety of `loop.call_soon_threadsafe` (#… · python/cpython@4685401 · GitHub
[go: up one dir, main page]

Skip to content

Commit 4685401

Browse files
gh-79149: document reentrant safety of loop.call_soon_threadsafe (#128662)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
1 parent a1284e9 commit 4685401

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

Doc/library/asyncio-eventloop.rst

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -246,6 +246,9 @@ Scheduling callbacks
246246
another thread, this function *must* be used, since :meth:`call_soon` is not
247247
thread-safe.
248248

249+
This function is safe to be called from a reentrant context or signal handler,
250+
however, it is not safe or fruitful to use the returned handle in such contexts.
251+
249252
Raises :exc:`RuntimeError` if called on a loop that's been closed.
250253
This can happen on a secondary thread when the main application is
251254
shutting down.

0 commit comments

Comments
 (0)
0