diff options
-rw-r--r-- | lib/rainbows/join_threads.rb | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/lib/rainbows/join_threads.rb b/lib/rainbows/join_threads.rb index ba67c94..5d5c64f 100644 --- a/lib/rainbows/join_threads.rb +++ b/lib/rainbows/join_threads.rb @@ -5,9 +5,13 @@ module Rainbows::JoinThreads # blocking acceptor threads must be forced to run def self.acceptors(threads) + expire = Time.now + Rainbows.server.timeout threads.delete_if do |thr| Rainbows.tick begin + # blocking accept() may not wake up properly + thr.raise(Errno::EINTR) if Time.now > expire && "sleep" == thr.status + thr.run thr.join(0.01) rescue |