gh-79149: document reentrant safety of loop.call_soon_threadsafe (#128662)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
This commit is contained in:
Kumar Aditya 2025-01-09 14:49:05 +05:30 committed by GitHub
parent a1284e9797
commit 4685401845
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -246,6 +246,9 @@ Scheduling callbacks
another thread, this function *must* be used, since :meth:`call_soon` is not another thread, this function *must* be used, since :meth:`call_soon` is not
thread-safe. 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. Raises :exc:`RuntimeError` if called on a loop that's been closed.
This can happen on a secondary thread when the main application is This can happen on a secondary thread when the main application is
shutting down. shutting down.