code: public synchronized void stop()
    {
      running.set(false);
      if(thread.isAlive()) {
        thread.interrupt();
        wait(this, STOP_TIMEOUT);
      }
    }
docs: Stop thread and waits for its graceful close. Please note that if {@link #STOP_TIMEOUT} exceeds this method does
  not guarantee graceful thread close.
  <p>
  If thread is not alive, see {@link Thread#isAlive()}, this method does nothing.