diff options
author | Larry Hastings <larry@hastings.org> | 2014-03-16 04:13:56 (GMT) |
---|---|---|
committer | Larry Hastings <larry@hastings.org> | 2014-03-16 04:13:56 (GMT) |
commit | 3732ed24145c1ac77e99bcf85bccda3af095e696 (patch) | |
tree | 432a243f5f4d9720ec0cc202ee969f6175e450b7 /Doc/library/asyncio-sync.rst | |
parent | b6b6a6d587d267cbad490232d08faebd30fdb7e2 (diff) | |
download | cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.zip cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.tar.gz cpython-3732ed24145c1ac77e99bcf85bccda3af095e696.tar.bz2 |
Merge in all documentation changes since branching 3.4.0rc1.
Diffstat (limited to 'Doc/library/asyncio-sync.rst')
-rw-r--r-- | Doc/library/asyncio-sync.rst | 29 |
1 files changed, 27 insertions, 2 deletions
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst index de38131..a299f09 100644 --- a/Doc/library/asyncio-sync.rst +++ b/Doc/library/asyncio-sync.rst @@ -64,7 +64,7 @@ Lock .. method:: locked() - Return ``True`` if lock is acquired. + Return ``True`` if the lock is acquired. .. method:: acquire() @@ -73,7 +73,7 @@ Lock This method blocks until the lock is unlocked, then sets it to locked and returns ``True``. - This method returns a :ref:`coroutine object <coroutine>`. + This method is a :ref:`coroutine <coroutine>`. .. method:: release() @@ -141,6 +141,15 @@ Condition A new :class:`Lock` object is created and used as the underlying lock. + .. method:: acquire() + + Acquire the underlying lock. + + This method blocks until the lock is unlocked, then sets it to locked and + returns ``True``. + + This method is a :ref:`coroutine <coroutine>`. + .. method:: notify(n=1) By default, wake up one coroutine waiting on this condition, if any. @@ -156,6 +165,10 @@ Condition call until it can reacquire the lock. Since :meth:`notify` does not release the lock, its caller should. + .. method:: locked() + + Return ``True`` if the underlying lock is acquired. + .. method:: notify_all() Wake up all threads waiting on this condition. This method acts like @@ -163,6 +176,18 @@ Condition calling thread has not acquired the lock when this method is called, a :exc:`RuntimeError` is raised. + .. method:: release() + + Release the underlying lock. + + When the lock is locked, reset it to unlocked, and return. If any other + coroutines are blocked waiting for the lock to become unlocked, allow + exactly one of them to proceed. + + When invoked on an unlocked lock, a :exc:`RuntimeError` is raised. + + There is no return value. + .. method:: wait() Wait until notified. |