From 1cf74260269b41d3e75c865b7b49d2f6caa45f28 Mon Sep 17 00:00:00 2001 From: calvin Date: Mon, 28 Mar 2005 15:56:25 +0000 Subject: [PATCH] public method is_locked() git-svn-id: https://linkchecker.svn.sourceforge.net/svnroot/linkchecker/trunk/linkchecker@2462 e7d03fd6-7b0d-0410-9947-9c21f3af8025 --- linkcheck/lock.py | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/linkcheck/lock.py b/linkcheck/lock.py index 026bd912..0810fe94 100644 --- a/linkcheck/lock.py +++ b/linkcheck/lock.py @@ -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()