From 8e35ef2b29d813727be013d3a299bdf475986db3 Mon Sep 17 00:00:00 2001 From: Joel Collins Date: Thu, 23 May 2019 14:25:26 +0100 Subject: [PATCH] Added locked() method to check lock state --- openflexure_microscope/lock.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/openflexure_microscope/lock.py b/openflexure_microscope/lock.py index 566ef80e..94e25f5d 100644 --- a/openflexure_microscope/lock.py +++ b/openflexure_microscope/lock.py @@ -11,6 +11,9 @@ class StrictLock(object): self._lock = RLock() self.timeout = timeout + def locked(self): + return self._lock.locked() + def acquire(self, blocking=True): return self._lock.acquire(blocking, timeout=self.timeout)