2 ivar_as_index :waiting => 1, :value => 2
3 def waiting; @waiting ; end
4 def value ; @value ; end
7 Ruby.primitive :channel_new
8 raise PrimitiveFailure, "primitive failed"
12 Ruby.primitive :channel_send
13 raise PrimitiveFailure, "primitive failed"
17 Ruby.primitive :channel_receive
18 raise PrimitiveFailure, "primitive failed"
21 def self.convert_to_channel(obj)
22 return obj if Channel === obj
26 raise ArgumentError, "to_channel on #{obj.inspect} did not return a Channel"
30 raise ArgumentError, "Unable to convert #{obj.inspect} into a channel"
34 def self.receive(*ary)
36 return convert_to_channel(ary.shift).receive
38 na = ary.map { |c| convert_to_channel(c) }