condition variable exercise