bpo-36794: Document that Lock.acquire is fair. (GH-13082) · python/cpython@34f4f5e

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.