Method: Concurrent::AtomicReference#set

Defined in:
lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb

#set(new_value) ⇒ Object

Sets to the given value.

Parameters:

  • new_value (Object)

    the new value

Returns:

  • (Object)

    the new value



126
127
128
129
130
131
132
133
134
# File 'lib/concurrent-ruby/concurrent/atomic/atomic_reference.rb', line 126

class AtomicReference < AtomicReferenceImplementation

  # @return [String] Short string representation.
  def to_s
    format '%s value:%s>', super[0..-2], get
  end

  alias_method :inspect, :to_s
end