void stop() {
        lock();
        try {
            if (isRunning()) {
                checkState(thread != null, "tried to stop null thread");
                boolean interrupted = false;
                thread.interrupt();
                while (thread.isAlive()) {
                    try {
                        thread.join(1000);
                    } catch (InterruptedException e) {
                        interrupted = true;
                    }
                }

                thread = null;
                if (interrupted) {
                    Thread.currentThread().interrupt();
                }
            }
        } finally {
            unlock();
        }
    }
Stops the current running thread if available.
core/src/main/java/com/linecorp/armeria/client/endpoint/RestartableThread.java