Interrupting or stopping a sleeping thread [duplicate]

Call the interrupt() method on your thread. This will cause the sleep to be cancelled and an InterruptedException will be thrown.

Leave a Comment