diff options
author | Zac Medico <zmedico@gentoo.org> | 2013-01-15 12:09:21 -0800 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2013-01-15 12:09:21 -0800 |
commit | dbe26095102cbdc6d5bef3509f05bc7b42c418cc (patch) | |
tree | fbdc5d18ff9fa33dc7b69fdb6c173312cb4507a8 /pym/_emerge/SubProcess.py | |
parent | 7c624515d0bb106c8a468addff5df153cebf31fc (diff) | |
download | portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.gz portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.tar.bz2 portage-dbe26095102cbdc6d5bef3509f05bc7b42c418cc.zip |
SpawnProcess: improve dummy pipe allocation logic
By using allocated file descriptors for keys in fd_pipes, we naturally
avoid interference with callers such as FileDigester and MergeProcess.
See the _setup_pipes docstring for more benefits of this allocation
approach.
Diffstat (limited to 'pym/_emerge/SubProcess.py')
-rw-r--r-- | pym/_emerge/SubProcess.py | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/pym/_emerge/SubProcess.py b/pym/_emerge/SubProcess.py index 92cbc27ab..4ccf9164f 100644 --- a/pym/_emerge/SubProcess.py +++ b/pym/_emerge/SubProcess.py @@ -1,4 +1,4 @@ -# Copyright 1999-2012 Gentoo Foundation +# Copyright 1999-2013 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 from portage import os @@ -9,12 +9,7 @@ import errno class SubProcess(AbstractPollTask): __slots__ = ("pid",) + \ - ("_files", "_reg_id") - - # A file descriptor is required for the scheduler to monitor changes from - # inside a poll() loop. When logging is not enabled, create a pipe just to - # serve this purpose alone. - _dummy_pipe_fd = 9 + ("_dummy_pipe_fd", "_files", "_reg_id") # This is how much time we allow for waitpid to succeed after # we've sent a kill signal to our subprocess. |