From 71cad8bd9aaf81da8eb81492a670010c9ca65859 Mon Sep 17 00:00:00 2001 From: Zac Medico Date: Tue, 14 Nov 2006 03:50:54 +0000 Subject: [PATCH] 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 --- pym/portage.py | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) 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)" -- 2.26.2