code: @Override
      public final synchronized void stopService(long millis) {
          running = false;
          try {
              if (keepRunning) {
                  keepRunning = false;
                  interrupt();
                  quit();
                  if (0L == millis) {
                      join();
                  } else {
                      join(millis);
                  }
              }
          } catch (InterruptedException e) {
              //its possible that the thread exits between the lines keepRunning=false and interrupt above
              log.warn("Got interrupted while stopping {}", this, e);
  
              Thread.currentThread().interrupt();
          }
      }
docs: Stops the service. If a timeout is given and the service has still not
  gracefully been stopped after timeout ms the service is stopped by force.
  
  @param millis value in ms