Object
A fixed size array with volatile volatile getters/setters. Usage:
arr = VolatileTuple.new(16) arr.volatile_set(0, :foo) arr.volatile_get(0) # => :foo arr.cas(0, :foo, :bar) # => true arr.volatile_get(0) # => :bar
# File lib/thread_safe/util/volatile_tuple.rb, line 32 def compare_and_set(i, old_value, new_value) @tuple[i].compare_and_set(old_value, new_value) end
# File lib/thread_safe/util/volatile_tuple.rb, line 41 def each @tuple.each {|ref| yield ref.get} end
# File lib/thread_safe/util/volatile_tuple.rb, line 37 def size @tuple.size end
Generated with the Darkfish Rdoc Generator 2.