From fb27f6d1e4bdae14b28b2b877547c0aaf6b54084 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Fri, 22 Oct 2010 12:04:34 -0700 Subject: AsynchronousLock: protect _wait() from recursion --- pym/_emerge/AsynchronousLock.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) (limited to 'pym/_emerge') diff --git a/pym/_emerge/AsynchronousLock.py b/pym/_emerge/AsynchronousLock.py index 3fe0e9747..fe9d36210 100644 --- a/pym/_emerge/AsynchronousLock.py +++ b/pym/_emerge/AsynchronousLock.py @@ -27,7 +27,7 @@ class AsynchronousLock(AsynchronousTask): __slots__ = ('path', 'scheduler',) + \ ('_imp', '_force_async', '_force_dummy', '_force_process', \ - '_force_thread') + '_force_thread', '_waiting') def _start(self): @@ -55,12 +55,15 @@ class AsynchronousLock(AsynchronousTask): def _imp_exit(self, imp): # call exit listeners - self.wait() + if not self._waiting: + self.wait() def _wait(self): if self.returncode is not None: return self.returncode - self.returncode = self._imp._wait() + self._waiting = True + self.returncode = self._imp.wait() + self._waiting = False return self.returncode def unlock(self): -- cgit v1.2.3-1-g7c22