From 76cd3e8e568ffc0762442c51ae6e968f89c88293 Mon Sep 17 00:00:00 2001 From: yenai Date: Thu, 5 Sep 2019 11:11:16 +0800 Subject: Add shared arg in metaclass Lock Add the missing arg 'shared' in the abstract method 'acquire' of the metaclass 'Lock'. Change-Id: I8572b0df2615f8f6e8f666be988b49e63a549679 --- tooz/locking.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/tooz/locking.py b/tooz/locking.py index 7d7ec81..f4ae0f0 100644 --- a/tooz/locking.py +++ b/tooz/locking.py @@ -97,13 +97,16 @@ class Lock(object): raise tooz.NotImplemented @abc.abstractmethod - def acquire(self, blocking=True): + def acquire(self, blocking=True, shared=False): """Attempts to acquire the lock. :param blocking: If True, blocks until the lock is acquired. If False, returns right away. Otherwise, the value is used as a timeout value and the call returns maximum after this number of seconds. + :param shared: If False, the lock is exclusive. If True, the lock can + be shareable or raises ``NotImplemented`` if not + implemented. :returns: returns true if acquired (false if not) :rtype: bool """ -- cgit v1.2.1