public abstract class ThreadUtil extends Object
| Modifier and Type | Field and Description |
|---|---|
static long |
DEFAULT_JOIN_TIMEOUT_MS |
| Modifier | Constructor and Description |
|---|---|
protected |
ThreadUtil() |
| Modifier and Type | Method and Description |
|---|---|
static Thread |
createAndStartForeverRunner(Runnable runnable) |
static Thread |
createAndStartForeverRunner(Runnable runnable,
String threadName) |
static Thread |
createAndStartForeverRunner(ThreadGroup group,
Runnable runnable,
String threadName) |
static Thread |
createAndStartForeverRunner(ThreadGroup group,
Runnable runnable,
String threadName,
long stackSize) |
static Thread |
createForeverRunner(Runnable runnable) |
static Thread |
createForeverRunner(Runnable runnable,
String threadName) |
static Thread |
createForeverRunner(ThreadGroup group,
Runnable runnable,
String threadName) |
static Thread |
createForeverRunner(ThreadGroup group,
Runnable runnable,
String threadName,
long stackSize) |
static boolean |
interruptAndJoin(Thread t) |
static boolean |
interruptAndJoin(Thread t,
long waitTime) |
static void |
sleepUntilMs(long time) |
public static final long DEFAULT_JOIN_TIMEOUT_MS
public static void sleepUntilMs(long time)
throws InterruptedException
InterruptedExceptionpublic static boolean interruptAndJoin(Thread t)
t - the thread which must be interrupted and joined with a default
timeouttrue for OK, false in case of an error.public static boolean interruptAndJoin(Thread t, long waitTime)
t - the thread which must be interruptedwaitTime - a specific timeout for the join operationtrue for OK, false in case of an error.public static Thread createForeverRunner(ThreadGroup group, Runnable runnable, String threadName)
public static Thread createForeverRunner(ThreadGroup group, Runnable runnable, String threadName, long stackSize)
public static Thread createAndStartForeverRunner(Runnable runnable, String threadName)
public static Thread createAndStartForeverRunner(ThreadGroup group, Runnable runnable, String threadName)
public static Thread createAndStartForeverRunner(ThreadGroup group, Runnable runnable, String threadName, long stackSize)
Copyright © 2012. All Rights Reserved.