| java.lang.Object java.lang.Thread com.tc.util.concurrent.StoppableThread
StoppableThread | public class StoppableThread extends Thread implements LifeCycleState(Code) | | This class isn't very exciting, nor is it best (or only) way to implement a (safe) stoppable thread. It is useful to
subclass StoppableThread if need to support stop functionality and you don't want to assume that it's okay to just
interrupt() the thread at any given moment. In my opinion, if the code you're running in the thread isn't entirely in
your control, you probably don't want to randomly interrupt it. For threads that spend most of their time blocking on
something, simply use a timeout and periodically check stopRequested() to see if it is time to stop.
README: You have to actually check stopRequested() someplace in your run() method for this thread to be "stoppable".
|
StoppableThread | public StoppableThread()(Code) | | |
isStopRequested | public boolean isStopRequested()(Code) | | |
requestStop | public void requestStop()(Code) | | |
stopAndWait | public boolean stopAndWait(long timeout)(Code) | | |
|
|