Permalink
Browse files

Merge pull request #8592 from rafaelfranca/warning_fix

Remove warning of intance variable not initialized
  • Loading branch information...
2 parents 0e4fb15 + 7f7c09c commit 501175e3ad6d17913a4f97df21fc0b4f9568dcac @guilleiguaran guilleiguaran committed Dec 25, 2012
Showing with 5 additions and 1 deletion.
  1. +5 −1 activesupport/lib/active_support/core_ext/thread.rb
@@ -65,6 +65,10 @@ def thread_variable?(key)
private
def locals
- @locals || LOCK.synchronize { @locals ||= {} }
+ if defined?(@locals)
+ @locals
+ else
+ LOCK.synchronize { @locals ||= {} }
+ end
end
end unless Thread.instance_methods.include?(:thread_variable_set)

0 comments on commit 501175e

Please sign in to comment.