lock shared mutex.