Package com.jogamp.common.util
Class InterruptSource.Thread
- java.lang.Object
-
- java.lang.Thread
-
- com.jogamp.common.util.InterruptSource.Thread
-
- All Implemented Interfaces:
InterruptSource
,Runnable
- Enclosing interface:
- InterruptSource
public static class InterruptSource.Thread extends Thread implements InterruptSource
- Since:
- 2.3.2
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class java.lang.Thread
Thread.State, Thread.UncaughtExceptionHandler
-
Nested classes/interfaces inherited from interface com.jogamp.common.util.InterruptSource
InterruptSource.Thread, InterruptSource.Util
-
-
Field Summary
-
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
-
-
Constructor Summary
Constructors Constructor Description Thread()
See {@link Thread#Thread(} for details.Thread(ThreadGroup tg, Runnable target)
SeeThread(ThreadGroup, Runnable)
for details.Thread(ThreadGroup tg, Runnable target, String name)
SeeThread(ThreadGroup, Runnable, String)
for details.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
clearInterruptSource()
Clears source and count ofThread.interrupt()
calls, if any.static InterruptSource.Thread
create(ThreadGroup tg, Runnable target, String name)
Depending on whethername
is null, eitherThread(ThreadGroup, Runnable, String)
orThread(ThreadGroup, Runnable)
is being utilized.int
getInterruptCounter(boolean clear)
Returns the count ofThread.interrupt()
calls.Throwable
getInterruptSource(boolean clear)
Returns the source of the last#interrupt()
call.void
interrupt()
-
Methods inherited from class java.lang.Thread
activeCount, checkAccess, clone, countStackFrames, currentThread, 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, suspend, toString, yield
-
-
-
-
Constructor Detail
-
Thread
public Thread()
See {@link Thread#Thread(} for details.
-
Thread
public Thread(ThreadGroup tg, Runnable target)
SeeThread(ThreadGroup, Runnable)
for details.- Parameters:
tg
- explicitThreadGroup
, may benull
target
- explicitRunnable
, may benull
-
Thread
public Thread(ThreadGroup tg, Runnable target, String name)
SeeThread(ThreadGroup, Runnable, String)
for details.- Parameters:
tg
- explicitThreadGroup
, may benull
target
- explicitRunnable
, may benull
name
- explicit name of thread, must not benull
-
-
Method Detail
-
create
public static InterruptSource.Thread create(ThreadGroup tg, Runnable target, String name)
Depending on whethername
is null, eitherThread(ThreadGroup, Runnable, String)
orThread(ThreadGroup, Runnable)
is being utilized.- Parameters:
tg
- explicitThreadGroup
, may benull
target
- explicitRunnable
, may benull
name
- explicit name of thread, may benull
-
getInterruptSource
public final Throwable getInterruptSource(boolean clear)
Description copied from interface:InterruptSource
Returns the source of the last#interrupt()
call.- Specified by:
getInterruptSource
in interfaceInterruptSource
- Parameters:
clear
- if true, issuesInterruptSource.clearInterruptSource()
-
getInterruptCounter
public final int getInterruptCounter(boolean clear)
Description copied from interface:InterruptSource
Returns the count ofThread.interrupt()
calls.- Specified by:
getInterruptCounter
in interfaceInterruptSource
- Parameters:
clear
- if true, issuesInterruptSource.clearInterruptSource()
-
clearInterruptSource
public final void clearInterruptSource()
Description copied from interface:InterruptSource
Clears source and count ofThread.interrupt()
calls, if any.- Specified by:
clearInterruptSource
in interfaceInterruptSource
-
-