class SharedChannelInputImpl<T> extends java.lang.Object implements SharedChannelInput<T>
Modifier and Type | Field and Description |
---|---|
private ChannelInternals<T> |
channel |
private int |
immunity |
Constructor and Description |
---|
SharedChannelInputImpl(ChannelInternals<T> _channel,
int _immunity) |
Modifier and Type | Method and Description |
---|---|
void |
endRead()
End an extended rendezvous.
|
void |
poison(int strength)
This injects poison into the channel.
|
T |
read()
Read an Object from the channel.
|
T |
startRead()
Begin an extended rendezvous read from the channel.
|
private ChannelInternals<T> channel
private int immunity
SharedChannelInputImpl(ChannelInternals<T> _channel, int _immunity)
public void endRead()
ChannelInput
startRead
.endRead
in interface ChannelInput<T>
public T read()
ChannelInput
read
in interface ChannelInput<T>
public T startRead()
ChannelInput
endRead
.
Only then will the writer be released (from its
write
method).
The writer is unaware of the extended nature of the communication.
The reader process must call
at some point after this function, otherwise the writer will not
be freed and deadlock will probably follow.
endRead
The reader process may perform any actions between calling
and
startRead
, including communications
on other channels. Further communications on this channel, of course,
should not be made.
endRead
An extended rendezvous may be started after the channel's Guard
has been selected by an Alternative
(i.e.
instead of
startRead
).read
startRead
in interface ChannelInput<T>
public void poison(int strength)
Poisonable
poison
in interface Poisonable
strength
- the strength of the poison (must be >= 0).