lib/ffi/libfuse/ackbar.rb in ffi-libfuse-0.0.1.pre vs lib/ffi/libfuse/ackbar.rb in ffi-libfuse-0.0.1.rctest11
- old
+ new
@@ -1,8 +1,9 @@
# frozen_string_literal: true
require_relative 'fuse_version'
+require 'io/wait'
module FFI
module Libfuse
# Its a trap!
#
@@ -70,14 +71,11 @@
# @return [Thread] the monitor thread
def monitor(name: 'SignalMonitor')
@monitor ||= Thread.new do
Thread.current.name = name
loop do
- timeout = block_given? ? yield : nil
-
- ready, _ignore_writable, _errors = ::IO.select([@pr], [], [], timeout)
-
- break if ready&.include?(@pr) && !self.next
+ @pr.wait_readable(block_given? ? yield : nil)
+ break unless self.next
end
end
end
# @!visibility private