
public final class PhaserImpl extends Object implements InternalPhaser
PhaserImpl class.
| Constructor and Description |
|---|
PhaserImpl(HjPhaserMode phMode,
PhaserManager phManager,
int busyWaitLimit)
Constructor for PhaserImpl.
|
PhaserImpl(String phName,
HjPhaserMode phMode,
PhaserManager phManager,
int busyWaitLimit)
Constructor for PhaserImpl.
|
| Modifier and Type | Method and Description |
|---|---|
int |
busyWaitLimit()
Returns the busyWaitLimit of the phaser.
|
void |
doNext()
The next operation has the effect of advancing each phaser on which the task is registered to its next phase,
thereby synchronizing all activities registered on the same phase.
|
void |
doWait()
Blocks until all phasers that this activity is registered with have called continue (or next since next implies
continue on all registered phasers).
|
boolean |
doWaitSingle1()
doWaitSingle1.
|
boolean |
doWaitSingle1(String loc)
doWaitSingle1.
|
void |
doWaitSingle2()
doWaitSingle2.
|
void |
drop(boolean activityEndSignal)
An activity calls this method to tell the phaser that it is no longer interested in interacting with the phaser.
|
boolean |
dropped()
dropped.
|
HjPhaserMode |
getPhaserMode()
Returns the registration mode of the phaser was created with.
|
edu.rice.hj.runtime.phasers.PhaserSigWaitState |
getPhaseState(int phase)
getPhaseState.
|
int |
getSigPhase()
Returns the signal phase number of this phaser in the currently executing task.
|
int |
getWaitPhase()
Returns the wait phase number of this phaser in the currently executing task.
|
long |
id()
Returns the id of the phaser.
|
HjPhaserPair |
inMode(HjPhaserMode phaserMode)
Return a
HjPhaserPair with the phaser in the specified registration mode. |
boolean |
quiescent()
quiescent.
|
void |
register(HabaneroActivity activity,
HjPhaserMode mode)
register.
|
boolean |
registered()
An activity may call this method to determine whether it is registered with this phaser or not.
|
void |
signal()
An activity calls this method to tell the phaser that is done with whatever it intended to do during this phase
of the phaser.
|
String |
toDetailedString()
toDetailedString.
|
String |
toString() |
public PhaserImpl(HjPhaserMode phMode, PhaserManager phManager, int busyWaitLimit)
Constructor for PhaserImpl.
phMode - The phaser registration mode. Should not be null.phManager - The phaser manager that governs the phaser operations.public PhaserImpl(String phName, HjPhaserMode phMode, PhaserManager phManager, int busyWaitLimit)
Constructor for PhaserImpl.
phName - The phaser name.phMode - The phaser registration mode. Should not be null.busyWaitLimit - The number of times to iterate in a busy wait loop before blockingphManager - The phaser manager that governs the phaser operations.public long id()
public int busyWaitLimit()
busyWaitLimit in interface InternalPhaserpublic int getSigPhase()
getSigPhase in interface HjPhaserpublic int getWaitPhase()
getWaitPhase in interface HjPhaserpublic HjPhaserPair inMode(HjPhaserMode phaserMode)
HjPhaserPair with the phaser in the specified registration mode.public HjPhaserMode getPhaserMode()
getPhaserMode in interface HjPhaserpublic void doNext()
throws SuspendableException
next is equivalent to a signal followed by wait.
doNext in interface HjPhaserSuspendableExceptionpublic void signal()
public edu.rice.hj.runtime.phasers.PhaserSigWaitState getPhaseState(int phase)
getPhaseState.
getPhaseState in interface InternalPhaserphase - a int.PhaserSigWaitState object.public void doWait()
throws SuspendableException
This method is used internally by the Runtime and should not be visible for clients. Clients should use Runtime.doNext().
doWait in interface HjPhaserSuspendableExceptionpublic boolean doWaitSingle1()
throws SuspendableException
doWaitSingle1.
doWaitSingle1 in interface InternalPhaserSuspendableExceptionpublic boolean doWaitSingle1(String loc) throws SuspendableException
doWaitSingle1.
doWaitSingle1 in interface InternalPhaserloc - The location of the next-with-single callSuspendableExceptionpublic void doWaitSingle2()
throws SuspendableException
doWaitSingle2.
doWaitSingle2 in interface InternalPhaserSuspendableExceptionpublic void drop(boolean activityEndSignal)
public boolean dropped()
dropped.
dropped in interface InternalPhaserpublic boolean registered()
registered in interface InternalPhaserpublic void register(HabaneroActivity activity, HjPhaserMode mode)
register.
register in interface InternalPhaseractivity - a HabaneroActivity object.mode - a HjPhaserMode object.public boolean quiescent()
quiescent.
quiescent in interface InternalPhaserCopyright © 2015 Rice University - Department of Computer Science. All rights reserved.