Implement condition variable, lock