public class Threads
extends java.lang.Object
Threads.| Modifier and Type | Method | Description |
|---|---|---|
static boolean |
checkInterrupted() |
Checks the interrupted status of the current thread
|
static void |
interrupt() |
Interrupts the current thread.
|
static void |
preserveInterruptedStatus(java.lang.InterruptedException e) |
Preserves the interrupted status of the current thread following an
InterruptedException. |
static void |
sleep(long duration,
java.util.concurrent.TimeUnit unit) |
Makes the current thread sleep the given duration.
|
public static boolean checkInterrupted()
public static void interrupt()
public static void preserveInterruptedStatus(java.lang.InterruptedException e)
InterruptedException.public static void sleep(long duration,
java.util.concurrent.TimeUnit unit)
InterruptedException.java.lang.IllegalArgumentException - if duration is negativejava.lang.IllegalArgumentException - if unit is null