@Override
    public void stop() throws Exception {
        waitForTerminate();
    }
It should guarantee thread-safe, and can be invoked many times.

@throws Exception exceptions
inlong-agent/agent-installer/src/main/java/org/apache/inlong/agent/installer/ModuleManager.java