InterruptedException. , , . , sleep, wait join, , , InterruptedException.
, , , ; , , , .
Thread.isInterrupted(), . Thread.interrupted() :
. , , false ( , , ).
while Thread.isInterrupted() :
, . .
, , . Thread.isInterrupted(), Thread.interrupted() InterruptedException, , , .
In addition, Thread.interrupt does not throw an InterruptedException. (And any exception thrown would be in the calling thread, not in the interruption of the thread.) The interrupt method is used to set the interrupt flag in another thread. If the interruption of the thread itself is pointless, the thread may return instead.
source
share