class Concurrent::ThreadLocalVar

def bind(value)

Returns:
  • (Object) - the value

Other tags:
    Yield: - the operation to be performed with the bound variable

Parameters:
  • value (Object) -- the value to bind
def bind(value)
  if block_given?
    old_value = self.value
    self.value = value
    begin
      yield
    ensure
      self.value = old_value
    end
  end
end