boolean (long timeout, @NotNull TimeUnit unit) { if (isShutdownHookRunning()) { try { myThread.join(unit.toMillis(timeout)); } catch (InterruptedException ignored) { } return !myThread.isAlive(); } return false; }