Change the mutex variable to condition variable