Added locked() method to check lock state

This commit is contained in:
Joel Collins 2019-05-23 14:25:26 +01:00
parent e30956d761
commit 8e35ef2b29

View file

@ -11,6 +11,9 @@ class StrictLock(object):
self._lock = RLock() self._lock = RLock()
self.timeout = timeout self.timeout = timeout
def locked(self):
return self._lock.locked()
def acquire(self, blocking=True): def acquire(self, blocking=True):
return self._lock.acquire(blocking, timeout=self.timeout) return self._lock.acquire(blocking, timeout=self.timeout)