From 019543aa3a1074582a460b944ad5ebcddecd4394 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 6 Oct 2013 11:02:38 +0000 Subject: buffer: remove ioctl syscall in common paths We do not need this for single sink situations (the common case) at all. We also do not need to check IO#nread for splice, either; we can just do non-blocking I/O. The only common path where we might still need it is the non-splice case with multiple sinks. --- lib/dtas/buffer.rb | 7 ++----- 1 file changed, 2 insertions(+), 5 deletions(-) (limited to 'lib/dtas/buffer.rb') diff --git a/lib/dtas/buffer.rb b/lib/dtas/buffer.rb index c9f096c..c0ba6a6 100644 --- a/lib/dtas/buffer.rb +++ b/lib/dtas/buffer.rb @@ -47,16 +47,13 @@ class DTAS::Buffer # :nodoc: # - some type of StandardError # - nil def broadcast(targets) - bytes = inflight - return :wait_readable if 0 == bytes # spurious wakeup - case targets.size when 0 :ignore # this will pause decoders when 1 - broadcast_one(targets, bytes) + broadcast_one(targets) else # infinity - broadcast_inf(targets, bytes) + broadcast_inf(targets) end end -- cgit v1.2.3-24-ge0c7