(self)
Wake up the first waiter if it isn't done.
Wake up the first waiter if it isn't done.
Wake up the first waiter if it isn t done .
def _wake_up_first(self):
        """Wake up the first waiter if it isn't done."""
        if not self._waiters:
            return
        try:
            fut = next(iter(self._waiters))
        except StopIteration:
            return

        # .done() necessarily means that a waiter will wake up later on and
        # either take the lock, or, if it was cancelled and lock wasn't
        # taken already, will hit this again and wake up a new waiter.
        if not fut.done():
            fut.set_result(True)
def _wake_up_first ( self ) : if not self . _waiters : return try : fut = next ( iter ( self . _waiters ) ) except StopIteration : return # .done() necessarily means that a waiter will wake up later on and # either take the lock, or, if it was cancelled and lock wasn't # taken already, will hit this again and wake up a new waiter. if not fut . done ( ) : fut . set_result ( True )