class Concurrent::IVar

def initialize(value = NULL, opts = {}, &block)

Options Hash: (**opts)
  • :copy_on_deref (String) -- call the given `Proc` passing
  • :freeze_on_deref (String) -- call `#freeze` before
  • :dup_on_deref (String) -- call `#dup` before returning

Parameters:
  • opts (Hash) -- the options to create a message with
  • value (Object) -- the initial value
def initialize(value = NULL, opts = {}, &block)
  if value != NULL && block_given?
    raise ArgumentError.new('provide only a value or a block')
  end
  super(&nil)
  synchronize { ns_initialize(value, opts, &block) }
end