Revert "counter_tick_core: don't lock if parallel-install"
authorZac Medico <zmedico@gentoo.org>
Sun, 15 May 2011 04:29:48 +0000 (21:29 -0700)
committerZac Medico <zmedico@gentoo.org>
Sun, 15 May 2011 04:29:48 +0000 (21:29 -0700)
This reverts commit 461564ae94ff936918eeaa18493bc1da3846796f.
Disabling the lock here doesn't really make sense, and I'm still
triggering EDEADLK is some other places.

pym/portage/dbapi/vartree.py

index 5db267d5396355247b01890cca1b9d909169c71f..40f0cfb0fd6bc243dbf255b3827ce87b48699c88 100644 (file)
@@ -815,15 +815,7 @@ class vardbapi(dbapi):
                """
                myroot = None
                mycpv = None
-               locked_vdb = False
-               if "parallel-install" not in self.settings.features:
-                       # If parallel-install is enabled, it's unsafe to
-                       # lock the vdb here since the portage.locks module
-                       # does not behave as desired if we try to lock the
-                       # same file multiple times concurrently from the
-                       # same process.
-                       self.lock()
-                       locked_vdb = True
+               self.lock()
                try:
                        counter = self.get_counter_tick_core() - 1
                        if self._cached_counter != counter:
@@ -837,8 +829,7 @@ class vardbapi(dbapi):
                                        write_atomic(self._counter_path, str(counter))
                                self._cached_counter = counter
                finally:
-                       if locked_vdb:
-                               self.unlock()
+                       self.unlock()
 
                return counter