diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-19 00:07:25 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2011-05-19 00:07:25 +0000 |
commit | d371e3583e3b1e0692f92343017b62d2628190ff (patch) | |
tree | be82924ada754f8542f394d0a3d28e0a0b02a098 /lib/shell/process-controller.rb | |
parent | 1fae66fca28167ca0e25625091c5df49405b8023 (diff) |
* lib: revert r31635-r31638 and untabify with expand(1).
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@31641 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib/shell/process-controller.rb')
-rw-r--r-- | lib/shell/process-controller.rb | 40 |
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 |