mirror of
https://github.com/Hopiu/linkchecker.git
synced 2026-04-11 01:50:59 +00:00
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:
parent
8e720030d1
commit
1cf7426026
1 changed files with 7 additions and 2 deletions
|
|
@ -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()
|
||||
|
|
|
|||
Loading…
Reference in a new issue