summaryrefslogtreecommitdiff
path: root/lib/irb/debug/ui.rb
diff options
context:
space:
mode:
authorStan Lo <stan001212@gmail.com>2023-10-11 15:16:32 +0100
committergit <svn-admin@ruby-lang.org>2023-10-11 14:16:39 +0000
commitcc311e1c4599200dd7437cd578e61c83067e555c (patch)
tree303c314f9f9a33d3da93b3b59d7031851af6b6dc /lib/irb/debug/ui.rb
parent380c25f89f9873e6fe9ee7aebd93b8bd0d2de5a0 (diff)
[ruby/irb] Avoid locking the debug UI to a single thread
(https://github.com/ruby/irb/pull/725) Since `debug` stores and updates the target thread via its Session's `@tc` variable, we don't need to and shouldn't lock the UI to the thread that activates the integration. https://github.com/ruby/irb/commit/202efdbf0c
Diffstat (limited to 'lib/irb/debug/ui.rb')
-rw-r--r--lib/irb/debug/ui.rb5
1 files changed, 2 insertions, 3 deletions
diff --git a/lib/irb/debug/ui.rb b/lib/irb/debug/ui.rb
index a4ca4fdf0f..307097b8c9 100644
--- a/lib/irb/debug/ui.rb
+++ b/lib/irb/debug/ui.rb
@@ -4,8 +4,7 @@ require 'debug/console'
module IRB
module Debug
class UI < DEBUGGER__::UI_Base
- def initialize(thread, irb)
- @thread = thread
+ def initialize(irb)
@irb = irb
end
@@ -56,7 +55,7 @@ module IRB
def readline _
setup_interrupt do
- tc = DEBUGGER__::SESSION.get_thread_client(@thread)
+ tc = DEBUGGER__::SESSION.instance_variable_get(:@tc)
cmd = @irb.debug_readline(tc.current_frame.binding || TOPLEVEL_BINDING)
case cmd