# File lib/childprocess/unix/process.rb, line 28 def exited? return true if @exit_code assert_started pid, status = ::Process.waitpid2(_pid, ::Process::WNOHANG | ::Process::WUNTRACED) pid = nil if pid == 0 # may happen on jruby log(:pid => pid, :status => status) if pid set_exit_code(status) end !!pid end
# File lib/childprocess/unix/process.rb, line 6 def io @io ||= Unix::IO.new end
# File lib/childprocess/unix/process.rb, line 10 def stop(timeout = 3) assert_started send_term begin return poll_for_exit(timeout) rescue TimeoutError # try next end send_kill wait rescue Errno::ECHILD, Errno::ESRCH # handle race condition where process dies between timeout # and send_kill true end
Generated with the Darkfish Rdoc Generator 2.