summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoryenai <yenai@cmss.chinamobile.com>2019-09-05 11:11:16 +0800
committeryenai <yenai@cmss.chinamobile.com>2019-09-05 11:17:19 +0800
commit76cd3e8e568ffc0762442c51ae6e968f89c88293 (patch)
treef88e51a1e59e4f9db290ab256d59fd54040996f9
parent5b280a85c548ecc247e4bd491841aef4d8575257 (diff)
downloadtooz-76cd3e8e568ffc0762442c51ae6e968f89c88293.tar.gz
Add shared arg in metaclass Lock
Add the missing arg 'shared' in the abstract method 'acquire' of the metaclass 'Lock'. Change-Id: I8572b0df2615f8f6e8f666be988b49e63a549679
-rw-r--r--tooz/locking.py5
1 files changed, 4 insertions, 1 deletions
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
"""