diff options
author | Zac Medico <zmedico@gentoo.org> | 2006-11-14 03:50:54 +0000 |
---|---|---|
committer | Zac Medico <zmedico@gentoo.org> | 2006-11-14 03:50:54 +0000 |
commit | 71cad8bd9aaf81da8eb81492a670010c9ca65859 (patch) | |
tree | 6a2d257dc5f3230ffa6e72a4137f6b7597a83e96 | |
parent | d66aff84fec2aa000616a421e429691f8d732a71 (diff) | |
download | portage-71cad8bd9aaf81da8eb81492a670010c9ca65859.tar.gz portage-71cad8bd9aaf81da8eb81492a670010c9ca65859.tar.bz2 portage-71cad8bd9aaf81da8eb81492a670010c9ca65859.zip |
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
-rw-r--r-- | pym/portage.py | 11 |
1 files 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)" |