class Concurrent::FiberLocalVar
def initialize(default = nil, &default_block)
-
default_block
(Proc
) -- Optional block that gets called to obtain the -
default
(Object
) -- the default value when otherwise unset
def initialize(default = nil, &default_block) if default && block_given? raise ArgumentError, "Cannot use both value and block as default value" end if block_given? @default_block = default_block @default = nil else @default_block = nil @default = default end @index = LOCALS.next_index(self) end