From c45bcf6145fe0a0a0bbc047a0739c3e9f6619d9a Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Wed, 8 Feb 2012 22:23:32 -0800 Subject: [PATCH] Use AbstractPollTask._wait_loop() more. --- pym/_emerge/AsynchronousLock.py | 6 ++---- pym/_emerge/FifoIpcDaemon.py | 6 +----- pym/_emerge/PipeReader.py | 5 +---- 3 files changed, 4 insertions(+), 13 deletions(-) diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py index 2c4fe108c..3cf0acbd5 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -152,8 +152,7 @@ class _LockThread(AbstractPollTask): def _wait(self): if self.returncode is not None: return self.returncode - while self._registered: - self.scheduler.iteration() + self._wait_loop() return self.returncode def unlock(self): @@ -264,8 +263,7 @@ class _LockProcess(AbstractPollTask): def _wait(self): if self.returncode is not None: return self.returncode - while self._registered: - self.scheduler.iteration() + self._wait_loop() return self.returncode def _output_handler(self, f, event): diff --git a/pym/_emerge/FifoIpcDaemon.py b/pym/_emerge/FifoIpcDaemon.py index cbe80589b..fcc4ab4b9 100644 --- a/pym/_emerge/FifoIpcDaemon.py +++ b/pym/_emerge/FifoIpcDaemon.py @@ -51,13 +51,9 @@ class FifoIpcDaemon(AbstractPollTask): def _wait(self): if self.returncode is not None: return self.returncode - - while self._registered: - self.scheduler.iteration() - + self._wait_loop() if self.returncode is None: self.returncode = os.EX_OK - return self.returncode def _input_handler(self, fd, event): diff --git a/pym/_emerge/PipeReader.py b/pym/_emerge/PipeReader.py index 54c6eb77e..90febdf44 100644 --- a/pym/_emerge/PipeReader.py +++ b/pym/_emerge/PipeReader.py @@ -43,10 +43,7 @@ class PipeReader(AbstractPollTask): def _wait(self): if self.returncode is not None: return self.returncode - - while self._registered: - self.scheduler.iteration() - + self._wait_loop() self.returncode = os.EX_OK return self.returncode -- 2.26.2