| |
|
| java.lang.Object java.lang.Thread com.mchange.v1.lang.GentleThread
GentleThread | abstract public class GentleThread extends Thread (Code) | | an abstract Thread class that provides
utilities for easily defining Threads with
safe versions of the deprecated thread
methods stop(), resume(), and start()
|
Method Summary | |
protected synchronized void | allowSuspend() tests whether the thread should suspend,
and causes to the thread to pause if appropriate. | public synchronized void | gentleResume() | public synchronized void | gentleStop() | public synchronized void | gentleSuspend() | abstract public void | run() | protected synchronized boolean | shouldStop() tests whether the thread should stop. | protected synchronized boolean | shouldSuspend() tests whether the thread should suspend. |
should_stop | boolean should_stop(Code) | | |
should_suspend | boolean should_suspend(Code) | | |
GentleThread | public GentleThread()(Code) | | |
allowSuspend | protected synchronized void allowSuspend() throws InterruptedException(Code) | | tests whether the thread should suspend,
and causes to the thread to pause if appropriate.
Subclasses should call this method periodically
in their run method to, um, allow suspension.
Threads paused by allowSuspend() will be properly
awoken by gentleResume()
See Also: GentleThread.gentleResume |
gentleResume | public synchronized void gentleResume()(Code) | | a safe method for resuming properly implemented GentleThreads
|
gentleStop | public synchronized void gentleStop()(Code) | | a safe method for stopping properly implemented GentleThreads
|
gentleSuspend | public synchronized void gentleSuspend()(Code) | | a safe method for suspending properly implemented GentleThreads
|
run | abstract public void run()(Code) | | |
shouldStop | protected synchronized boolean shouldStop()(Code) | | tests whether the thread should stop.
Subclasses should call this method periodically in
their run method, and return from run() is the
method returns true.
|
shouldSuspend | protected synchronized boolean shouldSuspend()(Code) | | tests whether the thread should suspend.
Subclasses rarely call this method directly,
and should call allowSuspend() periodically
instead.
See Also: GentleThread.allowSuspend |
|
|
|