From: Zac Medico Date: Mon, 7 Jul 2008 11:45:27 +0000 (-0000) Subject: Make SubProcess._wait() call scheduler.schedule(self.reg_id) so it's X-Git-Tag: v2.2_rc2~170 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=828bb49ecd6ca083a645bb44a0b445d742e622b6;p=portage.git Make SubProcess._wait() call scheduler.schedule(self.reg_id) so it's encapsulated and callers don't have to know about it. svn path=/main/trunk/; revision=10970 --- diff --git a/pym/_emerge/__init__.py b/pym/_emerge/__init__.py index 0037f988d..4c63a6379 100644 --- a/pym/_emerge/__init__.py +++ b/pym/_emerge/__init__.py @@ -1560,8 +1560,6 @@ class CompositeTask(AsynchronousTask): task = self._current_task if task is None: break - if hasattr(task, "reg_id"): - self.scheduler.schedule(task.reg_id) task.wait() return self.returncode @@ -1655,7 +1653,7 @@ class TaskSequence(CompositeTask): self.wait() class SubProcess(AsynchronousTask): - __slots__ = ("pid",) + __slots__ = ("pid", "reg_id", "scheduler") # 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 @@ -1686,6 +1684,7 @@ class SubProcess(AsynchronousTask): def _wait(self): if self.returncode is not None: return self.returncode + self.scheduler.schedule(self.reg_id) self._set_returncode(os.waitpid(self.pid, 0)) return self.returncode @@ -1713,7 +1712,7 @@ class SpawnProcess(SubProcess): "uid", "gid", "groups", "umask", "logfile", "path_lookup", "pre_exec") - __slots__ = ("args", "files", "registered", "reg_id", "scheduler") + \ + __slots__ = ("args", "files", "registered") + \ _spawn_kwarg_names _file_names = ("process", "out") @@ -2161,8 +2160,8 @@ class EbuildExecuter(CompositeTask): class EbuildPhase(SubProcess): __slots__ = ("fd_pipes", "phase", "pkg", - "scheduler", "settings", "tree", - "files", "registered", "reg_id") + "settings", "tree", + "files", "registered") _file_names = ("log", "stdout", "ebuild") _files_dict = slot_dict_class(_file_names, prefix="")