public class SigintWaiter
extends java.lang.Thread
Modifier and Type | Field and Description |
---|---|
private boolean |
running
For safely terminate this thread.
|
private Watcher |
watcher
The consumer for external interrupt.
|
Constructor and Description |
---|
SigintWaiter(Watcher watcher)
The constructor that accepts watcher instance as signal consumer.
|
Modifier and Type | Method and Description |
---|---|
void |
run()
The main worker method for this thread.
|
void |
shutdown()
The method to provide safe cleanup and exit.
|
private void |
stopWaitingSigint()
The native method to unblock SIGING waiting library.
|
private void |
unlockSigint()
The native method to resume SIGING interception in library.
|
private int |
waitForSigint()
The native method to wait for incoming SIGINT event.
|
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, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
private Watcher watcher
private volatile boolean running
public SigintWaiter(Watcher watcher)
watcher
- Target of the SIGINT interest.private int waitForSigint()
private void unlockSigint()
private void stopWaitingSigint()
public void run()
run
in interface java.lang.Runnable
run
in class java.lang.Thread
public void shutdown()