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(Runnable target)SeeThread(Runnable)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 voidclearInterruptSource()Clears source and count ofThread.interrupt()calls, if any.static InterruptSource.Threadcreate(ThreadGroup tg, Runnable target, String name)Depending on whethernameis null, eitherThread(ThreadGroup, Runnable, String)orThread(ThreadGroup, Runnable)is being utilized.intgetInterruptCounter(boolean clear)Returns the count ofThread.interrupt()calls.ThrowablegetInterruptSource(boolean clear)Returns the source of the last#interrupt()call.voidinterrupt()-
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(Runnable target)
SeeThread(Runnable)for details.- Parameters:
target- explicitRunnable, may benull
-
Thread
public Thread(ThreadGroup tg, Runnable target)
SeeThread(ThreadGroup, Runnable)for details.- Parameters:
tg- explicitThreadGroup, may benulltarget- explicitRunnable, may benull
-
Thread
public Thread(ThreadGroup tg, Runnable target, String name)
SeeThread(ThreadGroup, Runnable, String)for details.- Parameters:
tg- explicitThreadGroup, may benulltarget- explicitRunnable, may benullname- explicit name of thread, must not benull
-
-
Method Detail
-
create
public static InterruptSource.Thread create(ThreadGroup tg, Runnable target, String name)
Depending on whethernameis null, eitherThread(ThreadGroup, Runnable, String)orThread(ThreadGroup, Runnable)is being utilized.- Parameters:
tg- explicitThreadGroup, may benulltarget- explicitRunnable, may benullname- explicit name of thread, may benull
-
getInterruptSource
public final Throwable getInterruptSource(boolean clear)
Description copied from interface:InterruptSourceReturns the source of the last#interrupt()call.- Specified by:
getInterruptSourcein interfaceInterruptSource- Parameters:
clear- if true, issuesInterruptSource.clearInterruptSource()
-
getInterruptCounter
public final int getInterruptCounter(boolean clear)
Description copied from interface:InterruptSourceReturns the count ofThread.interrupt()calls.- Specified by:
getInterruptCounterin interfaceInterruptSource- Parameters:
clear- if true, issuesInterruptSource.clearInterruptSource()
-
clearInterruptSource
public final void clearInterruptSource()
Description copied from interface:InterruptSourceClears source and count ofThread.interrupt()calls, if any.- Specified by:
clearInterruptSourcein interfaceInterruptSource
-
-