Implement condition variables.