bpo-36794: Document that Lock.acquire is fair. (GH-13082)

https://bugs.python.org/issue36794
(cherry picked from commit 34f4f5efea)

Co-authored-by: Hrvoje Nikšić <hniksic@gmail.com>
This commit is contained in:
Miss Islington (bot) 2019-05-29 11:24:32 -07:00 committed by GitHub
parent cee95fe182
commit 4e1e887203
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View 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.