Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Remove warning of intance variable not initialized

  • Loading branch information...
commit 7f7c09c1f353b1775899d448a00a4eb1330a780c 1 parent 7ab469c
@rafaelfranca rafaelfranca 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)
Please sign in to comment.
Something went wrong with that request. Please try again.