All Packages Class Hierarchy This Package Previous Next Index
Class timer.WaitQueue
java.lang.Object
|
+----timer.WaitQueue
- public class WaitQueue
- extends Object
A utility class to queue up clients and process their actions
(which are presumed to take simulated time) in order. Each WaitQueue
serves one server object, and keeps a reference to it to synchronize
properly with its monitor. It is assumed that the queue interface
will be used from withing synchronized methods.
-
WaitQueue(Object)
- Create a new queue to work with a particular server object
-
SignalNext()
-
remove the current thread from the front of the queue, and
let the next waiter (if any) run.
-
Wait()
- queue up the current thread, and block until it reaches
the front of the queue (might not block if the queue is
currently empty.
WaitQueue
public WaitQueue(Object obj)
- Create a new queue to work with a particular server object
- Parameters:
- obj - the server object from which the queue's methods will
be called
Wait
public void Wait() throws IllegalMonitorStateException
- queue up the current thread, and block until it reaches
the front of the queue (might not block if the queue is
currently empty.
SignalNext
public void SignalNext() throws IllegalMonitorStateException, IllegalWaitQueueStateException
- remove the current thread from the front of the queue, and
let the next waiter (if any) run.
All Packages Class Hierarchy This Package Previous Next Index