Sha256: 86a7bb2beaf44e7f3ee4bb4667a382ec26c3262ccfb82874a6242d7f21f255dd

Contents?: true

Size: 703 Bytes

Versions: 4

Compression:

Stored size: 703 Bytes

Contents

module Debugger
  module TimeoutHandler
    class << self
      def do_thread_alias
        if defined? ::OldThread
          Debugger.print_debug 'Tried to re-alias thread for eval'
          return
        end

        Object.const_set :OldThread, ::Thread
        Object.__send__ :remove_const, :Thread
        Object.const_set :Thread, ::Debugger::DebugThread
      end

      def undo_thread_alias
        unless defined? ::OldThread
          Debugger.print_debug 'Tried to de-alias thread twice'
          return
        end

        Object.__send__ :remove_const, :Thread
        Object.const_set :Thread, ::OldThread
        Object.__send__ :remove_const, :OldThread
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 4 rubygems

Version Path
avalara_sdk-24.2.29 vendor/bundle/ruby/2.7.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/thread_alias.rb
ruby-debug-ide22-0.7.5 lib/ruby-debug-ide/thread_alias.rb
tdiary-5.2.0 vendor/bundle/ruby/3.0.0/gems/ruby-debug-ide-0.7.3/lib/ruby-debug-ide/thread_alias.rb
ruby-debug-ide-0.7.3 lib/ruby-debug-ide/thread_alias.rb