File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Load Diff This file was deleted.
Load Diff This file was deleted.
Original file line number Diff line number Diff line change @@ -2,11 +2,25 @@ module Debugger
22 module TimeoutHandler
33 class << self
44 def do_thread_alias
5- load File . expand_path ( File . dirname ( __FILE__ ) + '/thread-alias/alias_thread.rb' )
5+ if defined? ::OldThread
6+ Debugger . print_debug 'Tried to re-alias thread for eval'
7+ return
8+ end
9+
10+ Object . const_set :OldThread , ::Thread
11+ Object . send :remove_const , :Thread
12+ Object . const_set :Thread , ::Debugger ::DebugThread
613 end
714
815 def undo_thread_alias
9- load File . expand_path ( File . dirname ( __FILE__ ) + '/thread-alias/unalias_thread.rb' )
16+ unless defined? ::OldThread
17+ Debugger . print_debug 'Tried to de-alias thread twice'
18+ return
19+ end
20+
21+ Object . send :remove_const , :Thread
22+ Object . const_set :Thread , ::OldThread
23+ Object . send :remove_const , :OldThread
1024 end
1125 end
1226 end
You can’t perform that action at this time.
0 commit comments