class Concurrent::MutexAtomicReference
@!macro internal_implementation_note
@!visibility private
def _compare_and_set(old_value, new_value)
def _compare_and_set(old_value, new_value) synchronize do if @value.equal? old_value @value = new_value true else false end end end
def get
def get synchronize { @value } end
def get_and_set(new_value)
def get_and_set(new_value) synchronize do old_value = @value @value = new_value old_value end end
def initialize(value = nil)
def initialize(value = nil) super() synchronize { ns_initialize(value) } end
def ns_initialize(value)
def ns_initialize(value) @value = value end
def set(new_value)
def set(new_value) synchronize { @value = new_value } end