condvar added but not tested