summaryrefslogtreecommitdiff
path: root/Doc
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2019-05-29 11:24:32 -0700
committerGitHub <noreply@github.com>2019-05-29 11:24:32 -0700
commit4e1e887203ef069bf293ecabd945f7567d6a4879 (patch)
tree7acff70cd5c44c988f5fd6dbea9cfd3f3c08515b /Doc
parentcee95fe1825dfeb52d7074c8209b5884a079f06c (diff)
downloadcpython-git-4e1e887203ef069bf293ecabd945f7567d6a4879.tar.gz
bpo-36794: Document that Lock.acquire is fair. (GH-13082)
https://bugs.python.org/issue36794 (cherry picked from commit 34f4f5efea730504216ee19f237734e0bb0104ee) Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
Diffstat (limited to 'Doc')
-rw-r--r--Doc/library/asyncio-sync.rst7
1 files changed, 7 insertions, 0 deletions
diff --git a/Doc/library/asyncio-sync.rst b/Doc/library/asyncio-sync.rst
index 291310d714..993bd13fb0 100644
--- a/Doc/library/asyncio-sync.rst
+++ b/Doc/library/asyncio-sync.rst
@@ -66,6 +66,13 @@ Lock
This method waits until the lock is *unlocked*, sets it to
*locked* and returns ``True``.
+ When more than one coroutine is blocked in :meth:`acquire`
+ waiting for the lock to be unlocked, only one coroutine
+ eventually proceeds.
+
+ Acquiring a lock is *fair*: the coroutine that proceeds will be
+ the first coroutine that started waiting on the lock.
+
.. method:: release()
Release the lock.