Skip to content

Commit

Permalink
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
pitrou committed Nov 7, 2017
1 parent 39a156c commit 22b1128
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Doc/library/asyncio-task.rst
Expand Up @@ -216,7 +216,7 @@ Future
raise an exception when the future isn't done yet.

- Callbacks registered with :meth:`add_done_callback` are always called
via the event loop's :meth:`~AbstractEventLoop.call_soon_threadsafe`.
via the event loop's :meth:`~AbstractEventLoop.call_soon`.

- This class is not compatible with the :func:`~concurrent.futures.wait` and
:func:`~concurrent.futures.as_completed` functions in the
Expand Down
4 changes: 3 additions & 1 deletion Lib/asyncio/futures.py
Expand Up @@ -32,11 +32,13 @@ class Future:
Differences:
- This class is not thread-safe.
- result() and exception() do not take a timeout argument and
raise an exception when the future isn't done yet.
- Callbacks registered with add_done_callback() are always called
via the event loop's call_soon_threadsafe().
via the event loop's call_soon().
- This class is not compatible with the wait() and as_completed()
methods in the concurrent.futures package.
Expand Down

0 comments on commit 22b1128

Please sign in to comment.