Commit 7b2c3c68 authored by Victor Stinner's avatar Victor Stinner

asyncio doc: lock classes are not thread safe

parent ed135f46
......@@ -54,6 +54,8 @@ Lock
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 @@ Event
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 @@ Condition
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 @@ Semaphore
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.
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment