Method: PPipe::Methods#waitall
- Defined in:
- lib/parallelpipes.rb
#waitall ⇒ Object
Wait for all other processes to either finish or call ppipe.die - see wait
NB If more than one process calls waitall, both will wait for each other and hang forever!
1687 1688 1689 1690 1691 1692 1693 1694 1695 1696 1697 1698 1699 1700 1701 1702 1703 1704 |
# File 'lib/parallelpipes.rb', line 1687 def waitall #(wait_remote_child=false, *args) log 'fpv', 'waitall' raise DeadParallelPipe unless @alive # raise PPipeFatal.new("Only the root process (ppipe.is_root == true) can call waitall if there is no controller") unless @controller or @is_root # stop_controller if @controller loop do @pids.keys.each do |pipe_no| log 'v5', 'waiting for pipe_no', pipe_no must_wait = !(pipe_no == @mpn or (@controller and pipe_no == @controller)) wait(pipe_no) if must_wait # must_wait # arr.push status if status end log 'iv8', '@pids = ', @pids break unless @pids.keys.find{|pipe_no| !(pipe_no == @mpn) and (!@controller or !(pipe_no == @controller))} end end |