Implemented condition variables.