]> granicus.if.org Git - python/commitdiff
bpo-31960: Fix asyncio.Future documentation for thread (un)safety. (GH-4319) (#4320)
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Tue, 7 Nov 2017 16:22:18 +0000 (08:22 -0800)
committerAntoine Pitrou <pitrou@free.fr>
Tue, 7 Nov 2017 16:22:18 +0000 (17:22 +0100)
(cherry picked from commit 22b1128559bdeb96907da5840960691bb050d11a)

Doc/library/asyncio-task.rst
Lib/asyncio/futures.py

index 5298c11058c4b1864165e571249927b73d21b4d5..cc8fffb0659f24743ca96d05ebea2ec7f2b5bf47 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 cff9590e4ead5f3f5dd755891b8a979faf0034a6..511a14b97bce240e1f87f91792f56dbb5775c091 100644 (file)
@@ -112,11 +112,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.