aboutsummaryrefslogtreecommitdiffstats
path: root/lib/shell/process-controller.rb
diff options
context:
space:
mode:
Diffstat (limited to 'lib/shell/process-controller.rb')
-rw-r--r--lib/shell/process-controller.rb40
1 files changed, 20 insertions, 20 deletions
diff --git a/lib/shell/process-controller.rb b/lib/shell/process-controller.rb
index d50371fbbf..30f2229d39 100644
--- a/lib/shell/process-controller.rb
+++ b/lib/shell/process-controller.rb
@@ -1,8 +1,8 @@
#
# shell/process-controller.rb -
-# $Release Version: 0.7 $
-# $Revision$
-# by Keiju ISHITSUKA(keiju@ruby-lang.org)
+# $Release Version: 0.7 $
+# $Revision$
+# by Keiju ISHITSUKA(keiju@ruby-lang.org)
#
# --
#
@@ -157,19 +157,19 @@ class Shell
@waiting_jobs.delete command
else
command = @waiting_jobs.shift
- # command.notify "job(%id) pre-start.", @shell.debug?
+# command.notify "job(%id) pre-start.", @shell.debug?
return unless command
end
@active_jobs.push command
command.start
- # command.notify "job(%id) post-start.", @shell.debug?
+# command.notify "job(%id) post-start.", @shell.debug?
# start all jobs that input from the job
for job in @waiting_jobs.dup
start_job(job) if job.input == command
end
- # command.notify "job(%id) post2-start.", @shell.debug?
+# command.notify "job(%id) post2-start.", @shell.debug?
end
end
@@ -254,20 +254,20 @@ class Shell
pid = fork {
Thread.list.each do |th|
- # th.kill unless [Thread.main, Thread.current].include?(th)
- th.kill unless Thread.current == th
+# th.kill unless [Thread.main, Thread.current].include?(th)
+ th.kill unless Thread.current == th
end
- STDIN.reopen(pipe_peer_in)
- STDOUT.reopen(pipe_peer_out)
+ STDIN.reopen(pipe_peer_in)
+ STDOUT.reopen(pipe_peer_out)
- ObjectSpace.each_object(IO) do |io|
- if ![STDIN, STDOUT, STDERR].include?(io)
- io.close unless io.closed?
+ ObjectSpace.each_object(IO) do |io|
+ if ![STDIN, STDOUT, STDERR].include?(io)
+ io.close unless io.closed?
+ end
end
- end
- yield
+ yield
}
end
pid_cv.signal
@@ -283,8 +283,8 @@ class Shell
rescue Errno::ECHILD
command.notify "warn: job(%id) was done already waitpid."
_pid = true
- # rescue
- # STDERR.puts $!
+ # rescue
+ # STDERR.puts $!
ensure
command.notify("Job(%id): Wait to finish when Process finished.", @shell.debug?)
# when the process ends, wait until the command terminates
@@ -296,11 +296,11 @@ class Shell
redo
end
- # command.notify "job(%id) pre-pre-finish.", @shell.debug?
+# command.notify "job(%id) pre-pre-finish.", @shell.debug?
@job_monitor.synchronize do
- # command.notify "job(%id) pre-finish.", @shell.debug?
+# command.notify "job(%id) pre-finish.", @shell.debug?
terminate_job(command)
- # command.notify "job(%id) pre-finish2.", @shell.debug?
+# command.notify "job(%id) pre-finish2.", @shell.debug?
@job_condition.signal
command.notify "job(%id) finish.", @shell.debug?
end