let pair = Arc::new((Mutex::new(false), Condvar::new()));
I wonder why it wasn't done like this (which is how it is done with most? other types):
let cond = Arc::new(Mutex::new(Condvar::new(false)));
I believe this not only reads better as well as it is always the same for any type:
Instead we have for CondVar:
What I'm getting at that, is that instead of having CondVar somewhat next to Mutex, we could have it protected by Mutex. This would also mean less code, we would be sure that we only access the condvar is safe way etc.
Also, we could have easier way to actually use it:
let cond_var: Arc::new(Mutex::new(Condvar::new(false)))); ... later cond_var.lock().unwrap().notify(true/false);