]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
bpo-36794: Document that Lock.acquire is fair. (GH-13082) 13674/head
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>
Wed, 29 May 2019 18:24:32 +0000 (11:24 -0700)
committerGitHub <noreply@github.com>
Wed, 29 May 2019 18:24:32 +0000 (11:24 -0700)
https://bugs.python.org/issue36794
(cherry picked from commit 34f4f5efea730504216ee19f237734e0bb0104ee)

Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
Doc/library/asyncio-sync.rst

index 291310d71414e8e5d0ea4a4f0babcacb155829f4..993bd13fb0301366139ecb272d929e331579d75f 100644 (file)
@@ -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.