public class HaltingThread extends Thread
Thread.State, Thread.UncaughtExceptionHandler
Modifier and Type | Field and Description |
---|---|
protected boolean |
beenHalted
Boolean indicating if this thread has ever been 'halted'.
|
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
Constructor and Description |
---|
HaltingThread() |
HaltingThread(Runnable r) |
HaltingThread(Runnable r,
String name) |
HaltingThread(String name) |
Modifier and Type | Method and Description |
---|---|
void |
clearHalted()
Set's beenHalted to false.
|
void |
halt()
Set's beenHalted to true.
|
static void |
haltThread()
Calls 'halt' on
Thread.currentThread() if it is an
instance of HaltingThread otherwise it does nothing. |
static void |
haltThread(Thread t)
Calls 'halt' on
t if it is an instance of
HaltingThread otherwise it does nothing. |
static boolean |
hasBeenHalted()
Returns the result of calling hasBeenHalted on
Thread.currentThread() , if it is an instance of
HaltingThread otherwise it returns false. |
static boolean |
hasBeenHalted(Thread t)
Returns the result of calling hasBeenHalted on
t ,
if it is an instance of HaltingThread otherwise it returns false. |
boolean |
isHalted()
returns true if someone has halted the thread.
|
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, run, setContextClassLoader, setDaemon, setDefaultUncaughtExceptionHandler, setName, setPriority, setUncaughtExceptionHandler, sleep, sleep, start, stop, stop, suspend, toString, yield
protected boolean beenHalted
public HaltingThread()
public HaltingThread(Runnable r)
public HaltingThread(String name)
public boolean isHalted()
public void halt()
public void clearHalted()
public static void haltThread()
Thread.currentThread()
if it is an
instance of HaltingThread otherwise it does nothing.public static void haltThread(Thread t)
t
if it is an instance of
HaltingThread otherwise it does nothing.public static boolean hasBeenHalted()
Thread.currentThread()
, if it is an instance of
HaltingThread otherwise it returns false.public static boolean hasBeenHalted(Thread t)
t
,
if it is an instance of HaltingThread otherwise it returns false.Copyright © 2000–2019 Apache Software Foundation. All rights reserved.