Wait until a condition evaluates to true. predicate should be a callable which result will be interpreted as a boolean value. A timeout may be provided giving the maximum time to wait.
wait_for(predicate, timeout=None)
while not predicate():
cv.wait()