[Python-checkins] cpython (3.4): asyncio doc: lock classes are not thread safe

victor.stinner python-checkins at python.org
Thu Feb 26 10:39:39 CET 2015


https://hg.python.org/cpython/rev/366e3ad5e3bd
changeset:   94753:366e3ad5e3bd
branch:      3.4
parent:      94749:40a0c68ead00
user:        Victor Stinner <victor.stinner at gmail.com>
date:        Thu Feb 26 10:39:16 2015 +0100
summary:
  asyncio doc: lock classes are not thread safe

files:
  Doc/library/asyncio-sync.rst |  14 +++++++++++---
  1 files changed, 11 insertions(+), 3 deletions(-)


diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
--- a/Doc/library/asyncio-sync.rst
+++ b/Doc/library/asyncio-sync.rst
@@ -54,6 +54,8 @@
    Locks also support the context management protocol.  ``(yield from lock)``
    should be used as context manager expression.
 
+   This class is :ref:`not thread safe <asyncio-multithreading>`.
+
    Usage::
 
        lock = Lock()
@@ -117,6 +119,8 @@
    method.  The :meth:`wait` method blocks until the flag is true. The flag is
    initially false.
 
+   This class is :ref:`not thread safe <asyncio-multithreading>`.
+
    .. method:: clear()
 
       Reset the internal flag to false. Subsequently, coroutines calling
@@ -160,6 +164,8 @@
    object, and it is used as the underlying lock.  Otherwise,
    a new :class:`Lock` object is created and used as the underlying lock.
 
+   This class is :ref:`not thread safe <asyncio-multithreading>`.
+
    .. coroutinemethod:: acquire()
 
       Acquire the underlying lock.
@@ -252,6 +258,8 @@
    defaults to ``1``. If the value given is less than ``0``, :exc:`ValueError`
    is raised.
 
+   This class is :ref:`not thread safe <asyncio-multithreading>`.
+
    .. coroutinemethod:: acquire()
 
       Acquire a semaphore.
@@ -279,8 +287,8 @@
 
 .. class:: BoundedSemaphore(value=1, \*, loop=None)
 
-    A bounded semaphore implementation. Inherit from :class:`Semaphore`.
+   A bounded semaphore implementation. Inherit from :class:`Semaphore`.
 
-    This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would
-    increase the value above the initial value.
+   This raises :exc:`ValueError` in :meth:`~Semaphore.release` if it would
+   increase the value above the initial value.
 

-- 
Repository URL: https://hg.python.org/cpython


More information about the Python-checkins mailing list