class AltingChannelOutputIntSymmetricImpl extends AltingChannelOutputInt implements MultiwaySynchronisation
Modifier and Type | Field and Description |
---|---|
private AltingBarrier |
ab |
private ChannelOutputInt |
out |
private boolean |
syncDone |
Constructor and Description |
---|
AltingChannelOutputIntSymmetricImpl(AltingBarrier ab,
ChannelOutputInt out) |
Modifier and Type | Method and Description |
---|---|
(package private) boolean |
disable()
Disables the guard for selection.
|
(package private) boolean |
enable(Alternative alt)
Returns true if the event is ready.
|
boolean |
pending()
Returns whether the receiver is committed to read from this channel.
|
void |
poison(int strength)
This injects poison into the channel.
|
void |
write(int i)
Write an int to the channel.
|
private final AltingBarrier ab
private final ChannelOutputInt out
private boolean syncDone
public AltingChannelOutputIntSymmetricImpl(AltingBarrier ab, ChannelOutputInt out)
boolean enable(Alternative alt)
Guard
Note: this method should only be called by the Alternative class
boolean disable()
Guard
Note: this method should only be called by the Alternative class
public void write(int i)
ChannelOutputInt
write
in interface ChannelOutputInt
i
- the integer to write to the channelpublic boolean pending()
AltingChannelOutputInt
Note: if this returns true, you must commit to write down this channel.
pending
in class AltingChannelOutputInt
public void poison(int strength)
Poisonable
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).