public static boolean interrupted() { return Fiber.interrupted(); }
private void checkInterrupted() throws InterruptedException { if (Fiber.interrupted()) { interrupted(); throw new InterruptedException(); } }
public static boolean interrupted() { if (Fiber.currentFiber() != null) return Fiber.interrupted(); else return Thread.interrupted(); }
/** * Tests whether the current strand has been interrupted. The * <i>interrupted status</i> of the strand is cleared by this method. In * other words, if this method were to be called twice in succession, the * second call would return {@code false} (unless the current strand were * interrupted again, after the first call had cleared its interrupted * status and before the second call had examined it). * * @return {@code true} if the current thread has been interrupted; {@code false} otherwise. * @see #interrupt() * @see #isInterrupted() */ public static boolean interrupted() { if (isCurrentFiber()) return Fiber.interrupted(); else return Thread.interrupted(); }