Use PollScheduler iteration method.
authorZac Medico <zmedico@gentoo.org>
Wed, 8 Feb 2012 03:26:21 +0000 (19:26 -0800)
committerZac Medico <zmedico@gentoo.org>
Wed, 8 Feb 2012 03:34:16 +0000 (19:34 -0800)
pym/_emerge/AsynchronousLock.py
pym/_emerge/CompositeTask.py
pym/_emerge/FifoIpcDaemon.py
pym/_emerge/PipeReader.py
pym/_emerge/SubProcess.py

index e166df344202ca7b98269a38cc8a57d54c22aa37..2c4fe108c4fd186a0f4e35a115fada95f675d767 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 import dummy_threading
@@ -152,8 +152,8 @@ class _LockThread(AbstractPollTask):
        def _wait(self):
                if self.returncode is not None:
                        return self.returncode
-               if self._registered:
-                       self.scheduler.schedule(self._reg_id)
+               while self._registered:
+                       self.scheduler.iteration()
                return self.returncode
 
        def unlock(self):
@@ -264,8 +264,8 @@ class _LockProcess(AbstractPollTask):
        def _wait(self):
                if self.returncode is not None:
                        return self.returncode
-               if self._registered:
-                       self.scheduler.schedule(self._reg_id)
+               while self._registered:
+                       self.scheduler.iteration()
                return self.returncode
 
        def _output_handler(self, f, event):
index 644a69bb2eccc1d30f779fffb3fd7d87e4d359c2..e56188db125e93c781a49135b092557a90a0d906 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from _emerge.AsynchronousTask import AsynchronousTask
@@ -60,7 +60,8 @@ class CompositeTask(AsynchronousTask):
                                        self._current_task = None
                                        break
                                else:
-                                       self.scheduler.schedule(condition=self._task_queued_wait)
+                                       while not self._task_queued_wait():
+                                               self.scheduler.iteration()
                                        if self.returncode is not None:
                                                break
                                        elif self.cancelled:
index b1f7a95692cab0b9b9f6c9e001be217829fbf400..cbe80589b23f63aa93551fb30a1b94fb99feff3e 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 2010-2011 Gentoo Foundation
+# Copyright 2010-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -52,9 +52,8 @@ class FifoIpcDaemon(AbstractPollTask):
                if self.returncode is not None:
                        return self.returncode
 
-               if self._registered:
-                       self.scheduler.schedule(self._reg_id)
-                       self._unregister()
+               while self._registered:
+                       self.scheduler.iteration()
 
                if self.returncode is None:
                        self.returncode = os.EX_OK
index a85d794e21db9ad04a38157e4742318069fe298b..54c6eb77e7cea4f3fdf1175d0a2cf827fc1539da 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -44,9 +44,8 @@ class PipeReader(AbstractPollTask):
                if self.returncode is not None:
                        return self.returncode
 
-               if self._registered:
-                       self.scheduler.schedule(self._reg_ids)
-                       self._unregister()
+               while self._registered:
+                       self.scheduler.iteration()
 
                self.returncode = os.EX_OK
                return self.returncode
index c5cac7dde80839713ad7873e89b075a49bb09fe0..c3dc74a91fff9c0abdc81c1033c7154d24eb935c 100644 (file)
@@ -1,4 +1,4 @@
-# Copyright 1999-2011 Gentoo Foundation
+# Copyright 1999-2012 Gentoo Foundation
 # Distributed under the terms of the GNU General Public License v2
 
 from portage import os
@@ -77,7 +77,8 @@ class SubProcess(AbstractPollTask):
                                        if self._registered:
                                                self._orphan_process_warn()
                        else:
-                               self.scheduler.schedule(self._reg_id)
+                               while self._registered:
+                                       self.scheduler.iteration()
                        self._unregister()
                        if self.returncode is not None:
                                return self.returncode