diff --git a/src/labthings/core/lock.py b/src/labthings/core/lock.py index ffb4a5c4..93423662 100644 --- a/src/labthings/core/lock.py +++ b/src/labthings/core/lock.py @@ -33,7 +33,7 @@ def __init__(self, timeout=None, name=None): self.name = name @contextmanager - def acquire_timeout(self, timeout, blocking=True): + def __call__(self, timeout=sentinel, blocking=True): result = self.acquire(timeout=timeout, blocking=blocking) yield result if result: @@ -91,7 +91,7 @@ def __init__(self, locks, timeout=None): self.timeout = timeout @contextmanager - def acquire_timeout(self, timeout, blocking=True): + def __call__(self, timeout=sentinel, blocking=True): result = self.acquire(timeout=timeout, blocking=blocking) yield result if result: