aboutsummaryrefslogtreecommitdiffstats
path: root/activesupport
diff options
context:
space:
mode:
authorwangjohn <wangjohn@mit.edu>2013-04-09 19:20:49 -0400
committerwangjohn <wangjohn@mit.edu>2013-04-09 22:27:32 -0400
commite12901e4235d1ece2a17c5419f4420f1931cc6a4 (patch)
tree5bcd2ef9f09cc031f54f9475ec28c9f0e6b4c4e1 /activesupport
parent95ac3913ee24efa1c5a9789963697aaa6e5b32b7 (diff)
downloadrails-e12901e4235d1ece2a17c5419f4420f1931cc6a4.tar.gz
rails-e12901e4235d1ece2a17c5419f4420f1931cc6a4.tar.bz2
rails-e12901e4235d1ece2a17c5419f4420f1931cc6a4.zip
Changed the ScopeRegistry and the InstrumentationRegistry to use the
PerThreadRegistry module.
Diffstat (limited to 'activesupport')
-rw-r--r--activesupport/lib/active_support/notifications.rb9
1 files changed, 4 insertions, 5 deletions
diff --git a/activesupport/lib/active_support/notifications.rb b/activesupport/lib/active_support/notifications.rb
index ab2bb5fafe..5c985601f4 100644
--- a/activesupport/lib/active_support/notifications.rb
+++ b/activesupport/lib/active_support/notifications.rb
@@ -1,5 +1,6 @@
require 'active_support/notifications/instrumenter'
require 'active_support/notifications/fanout'
+require 'active_support/per_thread_registry'
module ActiveSupport
# = Notifications
@@ -190,12 +191,10 @@ module ActiveSupport
# The instrumenters for multiple notifiers are held in a single instance of
# this class.
class InstrumentationRegistry # :nodoc:
- class << self
- delegate :instrumenter_for, to: :current
+ extend ActiveSupport::PerThreadRegistry
- def current
- Thread.current[:instrumentation_registry] ||= new
- end
+ class << self
+ delegate :instrumenter_for, to: :instance
end
def initialize