Remove busy waiting and add condition lock in CPU