|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.clazzes.util.thread.ThreadStopper
public class ThreadStopper
Constructor Summary | |
---|---|
ThreadStopper()
Instantiates a new ThreadStopper instance, which is in the not-being-stopped state. |
Method Summary | |
---|---|
boolean |
isToBeFinished()
This method is used inside the thread's main loop in order to check, whether the thread has be stopped the next time it has finished a portion of his work. |
void |
requestStop()
Requests the thread to be stopped. |
void |
resume()
Requests the thread to be stopped. |
void |
waitToBeFinished()
|
boolean |
waitToBeFinished(long timeout)
This function waits up to the given timeout in milliseconds or exits immediately after requestStop() has been called. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public ThreadStopper()
Method Detail |
---|
public boolean isToBeFinished()
public boolean waitToBeFinished(long timeout) throws java.lang.InterruptedException
timeout
- The maximal number of milliseconds to wait.
java.lang.InterruptedException
- if some other thread calls Thread.interrupt on this Thread
while waiting.public void waitToBeFinished() throws java.lang.InterruptedException
java.lang.InterruptedException
public void requestStop()
public void resume()
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |