@ThreadSafe public final class ThreadX extends Thread
Modifier and Type | Class and Description |
---|---|
static class |
ThreadX.UncaughtExceptionLogger
A handler that logs uncaught exceptions and errors using the thread's associated
logger.
|
static class |
ThreadX.UncaughtExceptionPrinter
A handler that prints stack traces of uncaught exceptions and errors to the
standard error stream.
|
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
ThreadX() |
ThreadX(Runnable target) |
ThreadX(Runnable target,
String name) |
ThreadX(ThreadGroup threadGroup,
Runnable target,
String name) |
Modifier and Type | Method and Description |
---|---|
boolean |
tryJoin()
Same as join(), but returns normally if interrupted.
|
boolean |
tryJoin(long milliseconds)
Same as join(), but returns normally if
interrupted.
|
static boolean |
tryJoin(Thread thread)
Same as join(), but returns normally if
interrupted.
|
static boolean |
tryJoin(Thread thread,
long milliseconds)
Same as join(), but returns normally if
interrupted.
|
static boolean |
trySleep(long milliseconds)
Same as sleep(), but an interruption merely cuts
short the sleep.
|
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public ThreadX()
public ThreadX(ThreadGroup threadGroup, Runnable target, String name)
public boolean tryJoin()
public static boolean tryJoin(Thread thread)
public boolean tryJoin(long milliseconds)
public static boolean tryJoin(Thread thread, long milliseconds)