InterruptSource
, Runnable
public static class InterruptSource.Thread extends Thread implements InterruptSource
InterruptSource.Thread, InterruptSource.Util
Thread.State, Thread.UncaughtExceptionHandler
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor | Description |
---|---|
Thread() |
See {@link Thread#Thread(} for details.
|
Thread(ThreadGroup tg,
Runnable target) |
See
Thread(ThreadGroup, Runnable) for details. |
Thread(ThreadGroup tg,
Runnable target,
String name) |
See
Thread(ThreadGroup, Runnable, String) for details. |
Modifier and Type | Method | Description |
---|---|---|
void |
clearInterruptSource() |
Clears source and count of
Thread.interrupt() calls, if any. |
static InterruptSource.Thread |
create(ThreadGroup tg,
Runnable target,
String name) |
Depending on whether
name is null, either
Thread(ThreadGroup, Runnable, String) or
Thread(ThreadGroup, Runnable) is being utilized. |
int |
getInterruptCounter(boolean clear) |
Returns the count of
Thread.interrupt() calls. |
Throwable |
getInterruptSource(boolean clear) |
Returns the source of the last
#interrupt() call. |
void |
interrupt() |
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
activeCount, checkAccess, clone, countStackFrames, currentThread, destroy, dumpStack, enumerate, getAllStackTraces, getContextClassLoader, getDefaultUncaughtExceptionHandler, getId, getName, getPriority, getStackTrace, getState, getThreadGroup, getUncaughtExceptionHandler, holdsLock, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, onSpinWait, resume, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
public Thread()
public Thread(ThreadGroup tg, Runnable target)
Thread(ThreadGroup, Runnable)
for details.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
public Thread(ThreadGroup tg, Runnable target, String name)
Thread(ThreadGroup, Runnable, String)
for details.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
name
- explicit name of thread, must not be null
public static InterruptSource.Thread create(ThreadGroup tg, Runnable target, String name)
name
is null, either
Thread(ThreadGroup, Runnable, String)
or
Thread(ThreadGroup, Runnable)
is being utilized.tg
- explicit ThreadGroup
, may be null
target
- explicit Runnable
, may be null
name
- explicit name of thread, may be null
public final Throwable getInterruptSource(boolean clear)
InterruptSource
#interrupt()
call.getInterruptSource
in interface InterruptSource
clear
- if true, issues InterruptSource.clearInterruptSource()
public final int getInterruptCounter(boolean clear)
InterruptSource
Thread.interrupt()
calls.getInterruptCounter
in interface InterruptSource
clear
- if true, issues InterruptSource.clearInterruptSource()
public final void clearInterruptSource()
InterruptSource
Thread.interrupt()
calls, if any.clearInterruptSource
in interface InterruptSource