class Concurrent::Tuple
def compare_and_set(i, old_value, new_value)
-
(Boolean)
- true if the value at the given element was set else false
Parameters:
-
new_value
(Object
) -- the value to set at the given index -
old_value
(Object
) -- the value to compare against the current value -
i
(Integer
) -- the index for the element to set
def compare_and_set(i, old_value, new_value) return false if i >= @size || i < 0 @tuple[i].compare_and_set(old_value, new_value) end