Class Interrupts

java.lang.Object
tech.ydb.yoj.util.lang.Interrupts

public final class Interrupts extends Object
  • Method Details

    • isThreadInterrupted

      public static boolean isThreadInterrupted(Throwable t)
      Checks whether the current thread has been interrupted or got an interrupt-signaling exception (that is, an exception caused by InterruptedException, InterruptedIOException or one of their subclasses).
      Returns:
      true if current thread has its interrupt flag set or t is interrupt-signaling; false otherwise
      See Also:
    • isInterruptException

      public static boolean isInterruptException(Throwable t)
      Checks whether t is an interrupt-signaling exception (i.e. either is an InterruptedException or InterruptedIOException, or directly or indirectly caused by one of them).
      Returns:
      true if t is interrupt-signaling; false otherwise
      See Also:
    • isThreadInterrupted

      public static boolean isThreadInterrupted()
      Checks whether the current thread has its interrupt flag set. Does not change the interrupt flag.
      Returns:
      true if current thread has interrupt flag set; false otherwise
      See Also:
    • awaitTermination

      public static boolean awaitTermination(ExecutorService executor, Duration timeout)
    • runInCleanupMode

      public static void runInCleanupMode(Runnable action)