public method is_locked()

git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2462 e7d03fd6-7b0d-0410-9947-9c21f3af8025
This commit is contained in:
calvin 2005-03-28 15:56:25 +00:00
parent 8e720030d1
commit 1cf7426026

View file

@ -35,13 +35,18 @@ class AssertLock (lock_klass):
"""
Acquire lock.
"""
assert not self._is_owned(), "deadlock"
assert not self.is_locked(), "deadlock"
super(AssertLock, self).acquire(blocking=blocking)
def release (self):
"""
Release lock.
"""
assert self._is_owned(), "double release"
assert self.is_locked(), "double release"
super(AssertLock, self).release()
def is_locked (self):
"""
See if this lock is owned.
"""
return self._is_owned()