Revision 8c811986 lib/locking.py
b/lib/locking.py | ||
---|---|---|
1033 | 1033 |
else: |
1034 | 1034 |
return False |
1035 | 1035 |
|
1036 |
def owning_all(self): |
|
1037 |
"""Checks whether current thread owns internal lock. |
|
1038 |
|
|
1039 |
Holding the internal lock is equivalent with holding all locks in the set |
|
1040 |
(the opposite does not necessarily hold as it can not be easily |
|
1041 |
determined). L{add} and L{remove} require the internal lock. |
|
1042 |
|
|
1043 |
@rtype: boolean |
|
1044 |
|
|
1045 |
""" |
|
1046 |
return self.__lock.is_owned() |
|
1047 |
|
|
1036 | 1048 |
def _add_owned(self, name=None): |
1037 | 1049 |
"""Note the current thread owns the given lock""" |
1038 | 1050 |
if name is None: |
... | ... | |
1620 | 1632 |
""" |
1621 | 1633 |
return self.__keyring[level].check_owned(names, shared=shared) |
1622 | 1634 |
|
1635 |
def owning_all(self, level): |
|
1636 |
"""Checks whether current thread owns all locks at a certain level. |
|
1637 |
|
|
1638 |
@see: L{LockSet.owning_all} |
|
1639 |
|
|
1640 |
""" |
|
1641 |
return self.__keyring[level].owning_all() |
|
1642 |
|
|
1623 | 1643 |
def _upper_owned(self, level): |
1624 | 1644 |
"""Check that we don't own any lock at a level greater than the given one. |
1625 | 1645 |
|
Also available in: Unified diff