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)
GuardNote: this method should only be called by the Alternative class
boolean disable()
GuardNote: this method should only be called by the Alternative class
public void write(int i)
ChannelOutputIntwrite in interface ChannelOutputInti - the integer to write to the channelpublic boolean pending()
AltingChannelOutputIntNote: if this returns true, you must commit to write down this channel.
pending in class AltingChannelOutputIntpublic void poison(int strength)
Poisonablepoison in interface Poisonablestrength - the strength of the poison (must be >= 0).