Files

Class/Module Index [+]

Quicksearch

Concurrent::RubyThreadLocalVar

@!visibility private @!macro internal_implementation_note

Protected Instance Methods

allocate_storage() click to toggle source

@!visibility private

# File lib/concurrent/atomic/thread_local_var.rb, line 125
def allocate_storage
  @storage = WeakKeyMap.new
end
get() click to toggle source

@!visibility private

# File lib/concurrent/atomic/thread_local_var.rb, line 130
def get
  @storage[Thread.current]
end
set(value) click to toggle source

@!visibility private

# File lib/concurrent/atomic/thread_local_var.rb, line 135
def set(value)
  key = Thread.current

  @storage[key] = value

  if block_given?
    begin
      yield
    ensure
      @storage.delete(key)
    end
  end
end

[Validate]

Generated with the Darkfish Rdoc Generator 2.