From d98484dce25c8b6d22f18d6a4c3545ed42d34a1b Mon Sep 17 00:00:00 2001 From: richardsheridan Date: Mon, 8 Aug 2022 13:00:10 -0400 Subject: [PATCH] Document trio.from_thread.check_cancelled --- docs/source/reference-core.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docs/source/reference-core.rst b/docs/source/reference-core.rst index 58d583a39d..4ff10d1e4e 100644 --- a/docs/source/reference-core.rst +++ b/docs/source/reference-core.rst @@ -1820,6 +1820,11 @@ to spawn a child thread, and then use a :ref:`memory channel .. literalinclude:: reference-core/from-thread-example.py +You can also perform a non-blocking check for cancellation from threads spawned +by func:`trio.to_thread.run_sync`. + +.. autofunction:: trio.from_thread.check_cancelled + Threads and task-local storage ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~