Class: Thread

Inherits:
Object show all
Includes:
ContrastThread
Defined in:
lib/contrast/extension/thread.rb

Overview

Alias-chaining Thread#initialize.

Direct Known Subclasses

Contrast::Agent::Thread

Instance Method Summary collapse

Constructor Details

#initialize(*args, &block) ⇒ Thread

Returns a new instance of Thread.



20
21
22
23
24
25
26
27
28
29
30
31
32
# File 'lib/contrast/extension/thread.rb', line 20

def initialize *args, &block
  # Thread.current still references the original(callee) thread that is instantiating this new fiber during
  # initialization.
  Contrast::Components::Scope::MONITOR.synchronize do
    if (current_context = Thread.current[:current_context])
      self[:current_context] = current_context.dup
    end

    Contrast::Components::Scope.sweep_dead_ecs
  end

  cs__initialize(*args, &block)
end

Instance Method Details

#cs__initializeObject



18
# File 'lib/contrast/extension/thread.rb', line 18

alias_method :cs__initialize, :initialize