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;
    }
  }
public void tick ( ) throws InterruptedException { try ( LockResource r = new LockResource ( mLock ) ) { HeartbeatScheduler . addTimer ( this ) ; while ( ! mScheduled ) { mTickCondition . await ( ) ; } mScheduled = false ; } }
Waits until the heartbeat is scheduled for execution.

@throws InterruptedException if the thread is interrupted while waiting