code: public static void addShutdownHook(Runnable runnable) {
  		Runtime.getRuntime().addShutdownHook(
  				new Thread(runnable, "Thread-ShutDownHook-" + shutdownHookThreadIndex.incrementAndGet()));
  	}
docs: 注册JVM关闭时的钩子程序