

def wait(self, timeout=None):
    'Waits until the latch is released.\n\n        :param timeout: wait until the timeout expires\n        :type timeout: number\n        :returns: true if the latch has been released before the\n                  timeout expires otherwise false\n        :rtype: boolean\n        '
    watch = timeutils.StopWatch(duration=timeout)
    watch.start()
    with self._cond:
        while (self._count > 0):
            if watch.expired():
                return False
            else:
                self._cond.wait(timeout.leftover(return_none=True))
        return True

dataset/ETHPy150Open openstack/taskflow/taskflow/types/latch.py Latch.wait/VarMisuse@74/175 `watch`->`timeout`