/[gentoo-x86]/eclass/multiprocessing.eclass
Gentoo

Diff of /eclass/multiprocessing.eclass

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

Revision 1.1 Revision 1.2
1# Copyright 1999-2012 Gentoo Foundation 1# Copyright 1999-2012 Gentoo Foundation
2# Distributed under the terms of the GNU General Public License v2 2# Distributed under the terms of the GNU General Public License v2
3# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.1 2012/06/07 04:59:40 vapier Exp $ 3# $Header: /var/cvsroot/gentoo-x86/eclass/multiprocessing.eclass,v 1.2 2012/07/30 14:52:18 vapier Exp $
4 4
5# @ECLASS: multiprocessing.eclass 5# @ECLASS: multiprocessing.eclass
6# @MAINTAINER: 6# @MAINTAINER:
7# base-system@gentoo.org 7# base-system@gentoo.org
8# @AUTHOR: 8# @AUTHOR:
61# Setup the environment for executing code in parallel. 61# Setup the environment for executing code in parallel.
62# You must call this before any other multijob function. 62# You must call this before any other multijob function.
63multijob_init() { 63multijob_init() {
64 # When something goes wrong, try to wait for all the children so we 64 # When something goes wrong, try to wait for all the children so we
65 # don't leave any zombies around. 65 # don't leave any zombies around.
66 has wait ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" wait" 66 has wait ${EBUILD_DEATH_HOOKS} || EBUILD_DEATH_HOOKS+=" wait "
67 67
68 # Setup a pipe for children to write their pids to when they finish. 68 # Setup a pipe for children to write their pids to when they finish.
69 local pipe="${T}/multijob.pipe" 69 local pipe="${T}/multijob.pipe"
70 mkfifo "${pipe}" 70 mkfifo "${pipe}"
71 redirect_alloc_fd mj_control_fd "${pipe}" 71 redirect_alloc_fd mj_control_fd "${pipe}"
187 # Let bash clean up its internal child tracking state. 187 # Let bash clean up its internal child tracking state.
188 wait 188 wait
189 189
190 # Do this after reaping all the children. 190 # Do this after reaping all the children.
191 [[ $# -eq 0 ]] || die "${FUNCNAME} takes no arguments" 191 [[ $# -eq 0 ]] || die "${FUNCNAME} takes no arguments"
192
193 # No need to hook anymore.
194 EBUILD_DEATH_HOOKS=${EBUILD_DEATH_HOOKS/ wait / }
192 195
193 return ${ret} 196 return ${ret}
194} 197}
195 198
196# @FUNCTION: redirect_alloc_fd 199# @FUNCTION: redirect_alloc_fd

Legend:
Removed from v.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.20