The termination flag or termination status is an internal thread flag that is set when a thread is terminated. Set this up by calling thread.interrupt() on the thread object. If a thread is currently suspended within a method that throws an exception (wait, join, sleep, etc.), that method immediately throws a Canceled exception. A thread is free to handle this exception according to its own logic. If there is no thread in such a method and thread.interrupt() is called, nothing special happens. The thread is responsible for periodically checking the interrupt state using the static Thread.interrupted() method or the isInterrupted() instance. The difference between these methods is that  static Thread.interrupted() clears the interrupt flag, while isInterrupted() does not.