lib/fiber/local.rb
# Get the current thread-local instance. Create it if required.
# @returns [Object] The thread-local instance.
Get the current thread-local instance. Create it if required.
Get the current thread - local instance . Create it if required .
def instance
			thread = Thread.current
			name = self.name
			if instance = thread[self.name]
				return instance
			end
			unless instance = thread.thread_variable_get(name)
				if instance = self.local
					thread.thread_variable_set(name, instance)
				end
			end
			thread[self.name] = instance
			return instance
		end
def instance thread = Thread . current name = self . name if instance = thread [ self . name ] return instance end unless instance = thread . thread_variable_get ( name ) if instance = self . local thread . thread_variable_set ( name , instance ) end end thread [ self . name ] = instance return instance end
Get the current thread-local instance.
Get the current thread - local instance .
[Object] The thread-local instance.
[ Object ] The thread - local instance .