Package tech.ydb.yoj.util.lang
Class Interrupts
java.lang.Object
tech.ydb.yoj.util.lang.Interrupts
-
Method Summary
Modifier and TypeMethodDescriptionstatic booleanawaitTermination(ExecutorService executor, Duration timeout) static booleanChecks whether t is an interrupt-signaling exception (i.e.static booleanChecks whether the current thread has its interrupt flag set.static booleanChecks whether the current thread has been interrupted or got an interrupt-signaling exception (that is, an exception caused byInterruptedException,InterruptedIOExceptionor one of their subclasses).static voidrunInCleanupMode(Runnable action)
-
Method Details
-
isThreadInterrupted
Checks whether the current thread has been interrupted or got an interrupt-signaling exception (that is, an exception caused byInterruptedException,InterruptedIOExceptionor one of their subclasses).- Returns:
trueif current thread has its interrupt flag set ortis interrupt-signaling;falseotherwise- See Also:
-
isInterruptException
Checks whether t is an interrupt-signaling exception (i.e. either is anInterruptedExceptionorInterruptedIOException, or directly or indirectly caused by one of them).- Returns:
trueiftis interrupt-signaling;falseotherwise- See Also:
-
isThreadInterrupted
public static boolean isThreadInterrupted()Checks whether the current thread has its interrupt flag set. Does not change the interrupt flag.- Returns:
trueif current thread has interrupt flag set;falseotherwise- See Also:
-
awaitTermination
-
runInCleanupMode
-