avrora.sim.util
Class GlobalClock.Ticker
java.lang.Object
avrora.sim.util.GlobalClock.LocalMeet
avrora.sim.util.GlobalClock.Ticker
- All Implemented Interfaces:
- Simulator.Event
- Direct Known Subclasses:
- FreeSpaceAir.RadioTicker, SimpleAir.RadioTicker
- Enclosing class:
- GlobalClock
- public static class GlobalClock.Ticker
- extends GlobalClock.LocalMeet
The Ticker
class is an event that fires in the local queues of participating threads. This
class is necessary for ensuring the integrity of the global clock.
Method Summary |
void |
parallelAction(SimulatorThread s)
The parallelAction() method implements the functionality that must be performed in
parallel when the threads have joined at this local meet, and after the serial action has been
completed. |
void |
preSynchAction()
The preSynchAction() method implements the functionality that must be performed just
after the thread enters the local meet, but before it blocks waiting for the other threads. |
void |
serialAction()
The serialAction() method implements the functionality that must be performed in
serial when the threads have joined at this local meet. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
period
public final long period
eventQueue
protected final DeltaQueue eventQueue
GlobalClock.Ticker
protected GlobalClock.Ticker(long p)
preSynchAction
public void preSynchAction()
- Description copied from class:
GlobalClock.LocalMeet
- The
preSynchAction()
method implements the functionality that must be performed just
after the thread enters the local meet, but before it blocks waiting for the other threads. It is
called with the condition
monitor held.
- Specified by:
preSynchAction
in class GlobalClock.LocalMeet
serialAction
public void serialAction()
- Description copied from class:
GlobalClock.LocalMeet
- The
serialAction()
method implements the functionality that must be performed in
serial when the threads have joined at this local meet. This method will execute in the last thread
to enter the fire() method.
- Specified by:
serialAction
in class GlobalClock.LocalMeet
parallelAction
public void parallelAction(SimulatorThread s)
- Description copied from class:
GlobalClock.LocalMeet
- The
parallelAction()
method implements the functionality that must be performed in
parallel when the threads have joined at this local meet, and after the serial action has been
completed. It will be called in each thread, with the parameter passed being the current
SimulatorThread.
- Specified by:
parallelAction
in class GlobalClock.LocalMeet
- Parameters:
s
- the current SimulatorThread
instance for this thread