thread interrupt java example
If that thread is executing a low-level interruptible blocking method like Thread.sleep() , Thread.join() , or Object.wait() , it unblocks and throws InterruptedException. Otherwise, interrupt() merely sets the thread's interruption status.