Module: Process

Defined in:
lib/phusion_passenger/utils.rb

Class Method Summary collapse

Class Method Details

.timed_waitpid(pid, max_time) ⇒ Object



1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
# File 'lib/phusion_passenger/utils.rb', line 1046

def self.timed_waitpid(pid, max_time)
	done = false
	start_time = Time.now
	while Time.now - start_time < max_time && !done
		done = Process.waitpid(pid, Process::WNOHANG)
		sleep 0.1 if !done
	end
	return !!done
rescue Errno::ECHILD
	return true
end