Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Merge pull request #8592 from rafaelfranca/warning_fix

Remove warning of intance variable not initialized
  • Loading branch information...
commit 501175e3ad6d17913a4f97df21fc0b4f9568dcac 2 parents 0e4fb15 + 7f7c09c
@guilleiguaran guilleiguaran authored
Showing with 5 additions and 1 deletion.
  1. +5 −1 activesupport/lib/active_support/core_ext/thread.rb
View
6 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.
Something went wrong with that request. Please try again.