]> granicus.if.org Git - python/commitdiff
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (#4319)
authorAntoine Pitrou <pitrou@free.fr>
Tue, 7 Nov 2017 16:03:28 +0000 (17:03 +0100)
committerGitHub <noreply@github.com>
Tue, 7 Nov 2017 16:03:28 +0000 (17:03 +0100)
Doc/library/asyncio-task.rst
Lib/asyncio/futures.py

index fbb31b866aedd338ee2d765715ea5efc10a3539e..ff35b0add9d694febe817e1a8d8e5396944f78b4 100644 (file)
@@ -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
index 215f72d1910ecf7bbbd26af1e8784ae01b1bee4f..3dc9c500b339255c84a6d04c68bcb3a2bc015c10 100644 (file)
@@ -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.