class Concurrent::JavaThreadLocalVar

@!macro internal_implementation_note
@!visibility private

def allocate_storage

@!visibility private
def allocate_storage
  @var = java.lang.ThreadLocal.new
end

def value

@!macro thread_local_var_method_get
def value
  value = @var.get
  if value.nil?
    default
  elsif value == NULL
    nil
  else
    value
  end
end

def value=(value)

@!macro thread_local_var_method_set
def value=(value)
  @var.set(value)
end