private boolean runShutdownHooks() {
        boolean ran = false;
        // Note shutdown hooks can add / remove shutdown hooks.
        while (!this.shutdownHooks.isEmpty()) {
            final List<Runnable> copy = new ArrayList<>(this.shutdownHooks);
            this.shutdownHooks.clear();
            for (final Runnable task : copy) {
                try {
                    task.run();
                } catch (final Throwable t) {
                    LOG.warn("Shutdown hook raised an exception.", t);
                } finally {
                    ran = true;
                }
            }
        }
        return ran;
    }
Remove a previous added {@link Runnable} as a shutdown hook.
jraft-core/src/main/java/com/alipay/sofa/jraft/util/concurrent/MpscSingleThreadExecutor.java