From: Zac Medico Date: Tue, 14 Nov 2006 03:50:54 +0000 (-0000) Subject: Remove reentrance support for dblink.lockdb() since it's no longer used and it won... X-Git-Tag: v2.1.2~471 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=71cad8bd9aaf81da8eb81492a670010c9ca65859;p=portage.git Remove reentrance support for dblink.lockdb() since it's no longer used and it won't necessarily work correctly now that a global vdb lock is used. svn path=/main/trunk/; revision=5034 --- diff --git a/pym/portage.py b/pym/portage.py index 9c4dc13e6..c6dfd9286 100644 --- a/pym/portage.py +++ b/pym/portage.py @@ -6020,7 +6020,6 @@ class dblink: self.dbdir = self.dbpkgdir self._lock_vdb = None - self.lock_num = 0 # Count of the held locks on the db. self.settings = mysettings if self.settings==1: @@ -6036,14 +6035,14 @@ class dblink: self._contents_inodes = None def lockdb(self): - if self.lock_num == 0: - self._lock_vdb = portage_locks.lockdir(self.dbroot) - self.lock_num += 1 + if self._lock_vdb: + raise AssertionError("Lock already held.") + self._lock_vdb = portage_locks.lockdir(self.dbroot) def unlockdb(self): - self.lock_num -= 1 - if self.lock_num == 0: + if self._lock_vdb: portage_locks.unlockdir(self._lock_vdb) + self._lock_vdb = None def getpath(self): "return path to location of db information (for >>> informational display)"