code: public final void stop() {
          SystemException finalException = null;
  
          try {
              _interlock.await();
          } catch (InterruptedException ex) {
              Thread.currentThread().interrupt();
          } finally {
              try {
                  if (_unlocked) {
                      _log.info("Stopping {}.", getName());
                      doStop();
                  }
              } catch (Exception ex) {
                  finalException = new SystemException(ex);
              } finally {
                  _started = false;
              }
          }
          if (finalException != null) {
              throw finalException;
          }
      }
docs: Performs the actions of the {@link #doStop()} method. After this method completes either by normal execution or by throwing an exception, the
  interlock condition is satisfied and calls to {@link #start()} may proceed.