java.lang.Object
java.lang.Thread
net.i2p.router.tasks.Spinner
- All Implemented Interfaces:
Runnable
Shutdown delay thread to ensure complete router termination.
This non-daemon thread keeps the JVM alive during shutdown processes to prevent premature termination. During router shutdown, various cleanup tasks, file operations, and network shutdown procedures need time to complete properly.
Purpose:
- Prevents JVM from exiting before shutdown tasks finish
- Provides 5-minute window for complete cleanup
- Ensures file operations and network graceful shutdown complete
- Allows time for shutdown hooks to execute fully
As a non-daemon thread, the JVM will not terminate until this thread completes its 5-minute sleep or is interrupted. This is especially important for ensuring router.info files are written correctly and network connections are closed gracefully.
Nested Class Summary
Nested classes/interfaces inherited from class Thread
Thread.Builder, Thread.State, Thread.UncaughtExceptionHandlerField Summary
Fields inherited from class Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITYConstructor Summary
ConstructorsMethod Summary
All MethodsMethods inherited from class Thread
activeCount, clone, currentThread, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, isVirtual, join, join, join, join, ofPlatform, ofVirtual, onSpinWait, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, sleep, start, startVirtualThread, threadId, toString, yield
Constructor Details
Spinner
public Spinner()Create a new shutdown spinner thread. This is a non-daemon thread that keeps the JVM alive during shutdown processes to ensure they complete fully.
Method Details
run
public void run()Keep JVM alive for shutdown tasks to complete.This thread simply sleeps for 5 minutes to provide time for shutdown tasks to finish. As a non-daemon thread, it prevents the JVM from exiting until it completes.
The thread can be interrupted to terminate early if needed.