java.lang.Object
com.yaftp.utils.RunnerWaiter
- All Implemented Interfaces:
- java.io.Serializable
- public class RunnerWaiter
- extends java.lang.Object
- implements java.io.Serializable
Copyright Jean-Yves MENGANT 1998,1999,2000
the RunnerWaiter class is a scheduling class using
the basic TokenSemaphore system.
it can be used every time a Thread (The RUNNER) needs to
Synchronize another thread(The WAITER) using the following
rules :
THREAD 1 (starts and synchonizes THREAD 2 +
waits until THREAD 2)
startRUNNER() ;
DoWhatYouWant ;
stopRUNNER() ; // ==> BLOCK AND START WAITER
THREAD 2 (waits upon THREAD 1 initial completion
and start processing BLOCKING THREAD 1)
startWAITER() ; // BLOCK until RUNNER reschedules
DoWhatYouWant() ;
stopWAITER() ;
FOR A FULL EXAMPLE SEE The main static class of
TokenSemaphore which implements a full test of that
guy.
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
serialVersionUID
static final long serialVersionUID
theRunnerFlag
private transient TokenSemaphore theRunnerFlag
theWaiterFlag
private transient TokenSemaphore theWaiterFlag
RunnerWaiter
public RunnerWaiter()
startRUNNER
public void startRUNNER()
- Start the Runner
stopRUNNER
public void stopRUNNER()
startWAITER
public void startWAITER()
stopWAITER
public void stopWAITER()