'Release the lock.  If there is a waiting list, then the first
L{Deferred} in that waiting list will be called back.
Should be called by whomever did the L{acquire}() when the shared
resource is free.'

def release(self):

    assert self.locked, 'Tried    to    release    an    unlocked    lock'
    self.locked = False
    if self.waiting:
        self.locked = True
        d = self.waiting.pop(0)
        d.callback(self)
