java.lang.Object
java.lang.Thread
net.i2p.router.tasks.Spinner
All Implemented Interfaces:
Runnable

public class Spinnerextends Thread
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.

  • 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.

      Specified by:
      run in interface Runnable
      Overrides:
      run in class Thread