File tree Expand file tree Collapse file tree 3 files changed +16
-5
lines changed Expand file tree Collapse file tree 3 files changed +16
-5
lines changed 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
2
2
module TimeoutHandler
3
3
class << self
4
4
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
6
13
end
7
14
8
15
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
10
24
end
11
25
end
12
26
end
You can’t perform that action at this time.
0 commit comments