Top Description Inners Methods
com.jogamp.common.util

public Interface InterruptSource

Known Direct Implementers
com.jogamp.common.util.InterruptSource.Thread

Interface exposing java.lang.Thread#interrupt() source, intended for java.lang.Thread specializations.
Since
2.3.2

Nested and Inner Type Summary

Modifier and TypeClass and Description
public static class
public static class

Method Summary

Modifier and TypeMethod and Description
public void
clearInterruptSource()

Clears source and count of java.lang.Thread#interrupt() calls, if any.

public int
getInterruptCounter(final boolean
if true, issues clearInterruptSource()
clear
)

Returns the count of java.lang.Thread#interrupt() calls.

public Throwable
getInterruptSource(final boolean
if true, issues clearInterruptSource()
clear
)

Returns the source of the last interrupt() call.

Method Detail

clearInterruptSourceback to summary
public void clearInterruptSource()

Clears source and count of java.lang.Thread#interrupt() calls, if any.

getInterruptCounterback to summary
public int getInterruptCounter(final boolean clear)

Returns the count of java.lang.Thread#interrupt() calls.

Parameters
clear:boolean

if true, issues clearInterruptSource()

getInterruptSourceback to summary
public Throwable getInterruptSource(final boolean clear)

Returns the source of the last interrupt() call.

Parameters
clear:boolean

if true, issues clearInterruptSource()

com.jogamp.common.util back to summary

public Class InterruptSource.Thread

extends Thread
implements InterruptSource
Class Inheritance
All Implemented Interfaces
com.jogamp.common.util.InterruptSource

java.lang.Thread specialization implementing InterruptSource to track java.lang.Thread#interrupt() calls.
Since
2.3.2

Field Summary

Modifier and TypeField and Description
pack-priv volatile int
pack-priv volatile Throwable
pack-priv final Object
Inherited from java.lang.Thread:
MAX_PRIORITYMIN_PRIORITYNORM_PRIORITY

Constructor Summary

AccessConstructor and Description
public
Thread()

See Thread#Thread( for details.

public
Thread(final ThreadGroup
explicit ThreadGroup, may be null
tg
,
final Runnable
explicit Runnable, may be null
target
)

See Thread#Thread(ThreadGroup, Runnable) for details.

public
Thread(final ThreadGroup
explicit ThreadGroup, may be null
tg
,
final Runnable
explicit Runnable, may be null
target
,
final String
explicit name of thread, must not be null
name
)

See Thread#Thread(ThreadGroup, Runnable, String) for details.

Method Summary

Modifier and TypeMethod and Description
public final void
public static InterruptSource.Thread
create(final ThreadGroup
explicit ThreadGroup, may be null
tg
,
final Runnable
explicit Runnable, may be null
target
,
final String
explicit name of thread, may be null
name
)

Depending on whether name is null, either Thread(ThreadGroup, Runnable, String) or Thread(ThreadGroup, Runnable) is being utilized.

public final int
public final Throwable
getInterruptSource(final boolean
if true, issues clearInterruptSource()
clear
)

Implements com.jogamp.common.util.InterruptSource.getInterruptSource.

Returns the source of the last interrupt() call.
public final void
interrupt()

Overrides java.lang.Thread.interrupt.

Interrupts this thread.
Inherited from java.lang.Thread:
activeCountcheckAccessclonecurrentThreaddumpStackenumerategetAllStackTracesgetContextClassLoadergetDefaultUncaughtExceptionHandlergetIdgetNamegetPrioritygetStackTracegetStategetThreadGroupgetUncaughtExceptionHandlerholdsLockinterruptedisAliveisDaemonisInterruptedisVirtualjoinjoinjoinjoinofPlatformofVirtualonSpinWaitresumerunsetContextClassLoadersetDaemonsetDefaultUncaughtExceptionHandlersetNamesetPrioritysetUncaughtExceptionHandlersleepsleepsleepstartstartVirtualThreadstopsuspendthreadIdtoStringyield

Field Detail

interruptCounterback to summary
pack-priv volatile int interruptCounter
interruptSourceback to summary
pack-priv volatile Throwable interruptSource
syncback to summary
pack-priv final Object sync

Constructor Detail

Threadback to summary
public Thread()

See Thread#Thread( for details.

Threadback to summary
public Thread(final ThreadGroup tg, final Runnable target)

See Thread#Thread(ThreadGroup, Runnable) for details.

Parameters
tg:ThreadGroup

explicit ThreadGroup, may be null

target:Runnable

explicit Runnable, may be null

Threadback to summary
public Thread(final ThreadGroup tg, final Runnable target, final String name)

See Thread#Thread(ThreadGroup, Runnable, String) for details.

Parameters
tg:ThreadGroup

explicit ThreadGroup, may be null

target:Runnable

explicit Runnable, may be null

name:String

explicit name of thread, must not be null

Method Detail

clearInterruptSourceback to summary
public final void clearInterruptSource()

Implements com.jogamp.common.util.InterruptSource.clearInterruptSource.

Doc from com.jogamp.common.util.InterruptSource.clearInterruptSource.

Clears source and count of java.lang.Thread#interrupt() calls, if any.

Annotations
@Override
createback to summary
public static InterruptSource.Thread create(final ThreadGroup tg, final Runnable target, final String name)

Depending on whether name is null, either Thread(ThreadGroup, Runnable, String) or Thread(ThreadGroup, Runnable) is being utilized.

Parameters
tg:ThreadGroup

explicit ThreadGroup, may be null

target:Runnable

explicit Runnable, may be null

name:String

explicit name of thread, may be null

getInterruptCounterback to summary
public final int getInterruptCounter(final boolean clear)

Implements com.jogamp.common.util.InterruptSource.getInterruptCounter.

Doc from com.jogamp.common.util.InterruptSource.getInterruptCounter.

Returns the count of java.lang.Thread#interrupt() calls.

Parameters
clear:boolean

if true, issues clearInterruptSource()

Annotations
@Override
getInterruptSourceback to summary
public final Throwable getInterruptSource(final boolean clear)

Implements com.jogamp.common.util.InterruptSource.getInterruptSource.

Doc from com.jogamp.common.util.InterruptSource.getInterruptSource.

Returns the source of the last interrupt() call.

Parameters
clear:boolean

if true, issues clearInterruptSource()

Annotations
@Override
interruptback to summary
public final void interrupt()

Overrides java.lang.Thread.interrupt.

Doc from java.lang.Thread.interrupt.

Interrupts this thread.

Unless the current thread is interrupting itself, which is always permitted, the checkAccess method of this thread is invoked, which may cause a SecurityException to be thrown.

If this thread is blocked in an invocation of the wait(), wait(long), or wait(long, int) methods of the Object class, or of the join(), join(long), join(long, int), sleep(long), or sleep(long, int) methods of this class, then its interrupt status will be cleared and it will receive an InterruptedException.

If this thread is blocked in an I/O operation upon an InterruptibleChannel then the channel will be closed, the thread's interrupt status will be set, and the thread will receive a java.nio.channels.ClosedByInterruptException.

If this thread is blocked in a java.nio.channels.Selector then the thread's interrupt status will be set and it will return immediately from the selection operation, possibly with a non-zero value, just as if the selector's wakeup method were invoked.

If none of the previous conditions hold then this thread's interrupt status will be set.

Interrupting a thread that is not alive need not have any effect.

Annotations
@Override
com.jogamp.common.util back to summary

public Class InterruptSource.Util

extends Object
Class Inheritance

Constructor Summary

AccessConstructor and Description
public
Util()

Method Summary

Modifier and TypeMethod and Description
public static InterruptSource
currentThread()

Casts current java.lang.Thread to InterruptSource if applicable, otherwise returns null.

public static InterruptSource
get(final Thread t)

Casts given java.lang.Thread to InterruptSource if applicable, otherwise returns null.

Inherited from java.lang.Object:
cloneequalsfinalizegetClasshashCodenotifynotifyAlltoStringwaitwaitwait

Constructor Detail

Utilback to summary
public Util()

Method Detail

currentThreadback to summary
public static InterruptSource currentThread()

Casts current java.lang.Thread to InterruptSource if applicable, otherwise returns null.

getback to summary
public static InterruptSource get(final Thread t)

Casts given java.lang.Thread to InterruptSource if applicable, otherwise returns null.