Go backward to getChannel : Retrieving a Channel from a SetGo up to 5.4 Channel Sets |
select
: Selecting a Channel from a Seti = s.select() i = s.select(t) int i InChannelSet s int t
The first variant returns the index of a non-empty channel in the (non-empty) set s; if all channels are empty, the current node is blocked until a channel becomes non-empty. This index may be used to reference the corresponding channel in the set.
The second variant behaves like the first one except for the fact that the current node is blocked for at most t time units. If then all channels are still empty, -1 is returned.