From: Zac Medico Date: Fri, 22 Oct 2010 19:04:34 +0000 (-0700) Subject: AsynchronousLock: protect _wait() from recursion X-Git-Tag: v2.1.9.25~61 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=85997e716b74c96aaab07421a85b3afc93403dfd;p=portage.git AsynchronousLock: protect _wait() from recursion --- 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):