Skip to content

Commit 34f4f5e

Browse files
hniksicmiss-islington
authored andcommitted
bpo-36794: Document that Lock.acquire is fair. (GH-13082)
https://bugs.python.org/issue36794
1 parent 46ed90d commit 34f4f5e

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

Doc/library/asyncio-sync.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,13 @@ Lock
6666
This method waits until the lock is *unlocked*, sets it to
6767
*locked* and returns ``True``.
6868

69+
When more than one coroutine is blocked in :meth:`acquire`
70+
waiting for the lock to be unlocked, only one coroutine
71+
eventually proceeds.
72+
73+
Acquiring a lock is *fair*: the coroutine that proceeds will be
74+
the first coroutine that started waiting on the lock.
75+
6976
.. method:: release()
7077

7178
Release the lock.

0 commit comments

Comments
 (0)