code: @FFDCIgnore(IllegalStateException.class)
      public void addShutdownHook() {
          try {
              if (hookSet.compareAndSet(false, true)) {
                  Runtime.getRuntime().addShutdownHook(this);
              }
          } catch (IllegalStateException e) {
              // ok. based on timing, if we start shutting down, we may
              // not be able to remove the hook.
          }
      }
docs: Add the shutdown hook to the VM (FeatureManager.activate)
  
  @see {@link Runtime#addShutdownHook(Thread)}