Skip to content

Commit

Permalink
Prefer wait_readable for fiber scheduler.
Browse files Browse the repository at this point in the history
  • Loading branch information
ioquatix committed Dec 11, 2021
1 parent ad67f02 commit fa066cb
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/reline/ansi.rb
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ def self.inner_getc
unless @@buf.empty?
return @@buf.shift
end
until c = @@input.raw(intr: true) { select([@@input], [], [], 0.1) && @@input.getbyte }
until c = @@input.raw(intr: true) { @@input.wait_readable(0.1) && @@input.getbyte }
Reline.core.line_editor.resize
end
(c == 0x16 && @@input.raw(min: 0, tim: 0, &:getbyte)) || c
Expand Down
2 changes: 1 addition & 1 deletion lib/reline/general_io.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ def self.getc
end
c = nil
loop do
result = select([@@input], [], [], 0.1)
result = @@input.wait_readable(0.1)
next if result.nil?
c = @@input.read(1)
break
Expand Down

0 comments on commit fa066cb

Please sign in to comment.