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