Skip to content

Commit c2b0bb0

Browse files
jfirebaughdenofevil
authored andcommitted
Improve debugger responsiveness by not sleeping 0.1 sec between commands
1 parent 21166bb commit c2b0bb0

File tree

2 files changed

+4
-6
lines changed

2 files changed

+4
-6
lines changed

lib/ruby-debug-ide/ide_processor.rb

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,7 @@ def process_commands
2929
end
3030
event_cmds = Command.commands.map{|cmd| cmd.new(state, @printer) }
3131
while !state.proceed? do
32-
input = @interface.command_queue.empty? ? nil : @interface.command_queue.shift
33-
unless input
34-
sleep 0.1
35-
next
36-
end
32+
input = @interface.command_queue.pop
3733
catch(:debug_error) do
3834
splitter[input].each do |input|
3935
# escape % since print_debug might use printf

lib/ruby-debug-ide/interface.rb

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
require 'thread'
2+
13
class TCPSocket
24

35
# Workaround for JRuby issue http://jira.codehaus.org/browse/JRUBY-2063
@@ -24,7 +26,7 @@ class RemoteInterface < Interface # :nodoc:
2426

2527
def initialize(socket)
2628
@socket = socket
27-
@command_queue = []
29+
@command_queue = Queue.new
2830
end
2931

3032
def read_command

0 commit comments

Comments
 (0)