Java tutorial
//package com.java2s; //License from project: Apache License public class Main { /** * If the thread has been interrupted, throws an InterruptedException. */ public static void checkForInterruption() throws InterruptedException { if (Thread.currentThread().isInterrupted()) throw new InterruptedException(); } }