Method: Concurrent::IVar#initialize
- Defined in:
- lib/concurrent/ivar.rb
#initialize(value = NULL, opts = {}, &block) ⇒ IVar
Create a new ‘IVar` in the `:pending` state with the (optional) initial value.
61 62 63 64 65 66 67 |
# File 'lib/concurrent/ivar.rb', line 61 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 |