buildbot/buildbot — pull request #478 by jstultz (2012-07-27 00:35:38+00:00)
Title: Maintain locks in FIFO order

Locks should be kept in a queue in FIFO order to prevent potential
exclusive lock holders from being starved by a continuous stream of
counting locks holders.

This change maintains order of all waiters in a FIFO queue until they
actually acquire the lock, instead of removing them from the queue on
wake and adding them back to the end if they failed to acquire the lock.

The Deferred instance associated with each waiter is cleared when it is
woken. It is set when waitUntilMaybeAvailable is called.