Class Net::SSH::Compat

  1. lib/net/ssh/ruby_compat.rb
Parent: Object

This class contains miscellaneous patches and workarounds for different ruby implementations.

Methods

public class

  1. io_select
  2. io_select

Constants

SELECT_MUTEX = Mutex.new

Public class methods

io_select (*params)
[show source]
    # File lib/net/ssh/ruby_compat.rb, line 21
21:       def self.io_select(*params)
22:         IO.select(*params)
23:       end
io_select (*params)
[show source]
    # File lib/net/ssh/ruby_compat.rb, line 26
26:       def self.io_select(*params)
27:         # It should be safe to wrap calls in a mutex when the timeout is 0
28:         # (that is, the call is not supposed to block).
29:         # We leave blocking calls unprotected to avoid causing deadlocks.
30:         # This should still catch the main case for Capistrano users.
31:         if params[3] == 0
32:           SELECT_MUTEX.synchronize do
33:             IO.select(*params)
34:           end
35:         else
36:           IO.select(*params)
37:         end
38:       end