void update(int status,int leaderId){
  lock.lock();
  try {
    this.status=status;
    this.leaderId=leaderId;
    updateCond.signal();
  }
  finally {
    lock.unlock();
  }
}

void update ( int status , int leaderId ) { lock . lock ( ) ; try { this . status = status ; this . leaderId = leaderId ; updateCond . signal ( ) ; } finally { lock . unlock ( ) ; } }
called by coremember on command objects that are awaiting state changes . if errormessage is not null , all commands whose index is > commitindex are signaled with an error . otherwise all commands whose index < = commitindex are released .
