Usage of Condvar in Rust is something like this:
let pair = Arc::new((Mutex::new(true), Condvar::new()));
//...
let (lock, cvar) = &*pair;
let _guard = cvar.wait_while(lock.lock().unwrap(), SOMETHING_HERE).unwrap();
Is there something that I can put in SOMETHING_HERE that waits in the right way? I'm thinking about the simplest way of solving this.
My idea is to have a third condition variable that waits for two variables related to the other conditions, but I don't know how to do this.