diff options
author | Zac Medico <zmedico@gentoo.org> | 2010-10-22 12:04:34 -0700 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2010-10-22 12:04:34 -0700 |
commit | fb27f6d1e4bdae14b28b2b877547c0aaf6b54084 (patch) | |
tree | 8badac278812da20611407a15a83f80bd4d3b47c | |
parent | 2a3135fc27c83ccae3228011f98191e5dbf475a5 (diff) | |
download | portage-fb27f6d1e4bdae14b28b2b877547c0aaf6b54084.tar.gz portage-fb27f6d1e4bdae14b28b2b877547c0aaf6b54084.tar.bz2 portage-fb27f6d1e4bdae14b28b2b877547c0aaf6b54084.zip |
AsynchronousLock: protect _wait() from recursion
-rw-r--r-- | pym/_emerge/AsynchronousLock.py | 9 |
1 files changed, 6 insertions, 3 deletions
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): |