code: public void tick() throws InterruptedException {
      try (LockResource r = new LockResource(mLock)) {
        HeartbeatScheduler.addTimer(this);
        // Wait in a loop to handle spurious wakeups
        while (!mScheduled) {
          mTickCondition.await();
        }
  
        mScheduled = false;
      }
    }
docs: Waits until the heartbeat is scheduled for execution.
  
  @throws InterruptedException if the thread is interrupted while waiting