Revision 71e1863e
b/lib/locking.py | ||
---|---|---|
841 | 841 |
# Support passing in a single resource to acquire rather than many |
842 | 842 |
if isinstance(names, basestring): |
843 | 843 |
names = [names] |
844 |
else: |
|
845 |
names = sorted(names) |
|
846 | 844 |
|
847 | 845 |
return self.__acquire_inner(names, False, shared, |
848 | 846 |
running_timeout.Remaining, test_notify) |
... | ... | |
891 | 889 |
|
892 | 890 |
# First we look the locks up on __lockdict. We have no way of being sure |
893 | 891 |
# they will still be there after, but this makes it a lot faster should |
894 |
# just one of them be the already wrong |
|
895 |
for lname in utils.UniqueSequence(names): |
|
892 |
# just one of them be the already wrong. Using a sorted sequence to prevent |
|
893 |
# deadlocks. |
|
894 |
for lname in sorted(utils.UniqueSequence(names)): |
|
896 | 895 |
try: |
897 | 896 |
lock = self.__lockdict[lname] # raises KeyError if lock is not there |
898 | 897 |
except KeyError: |
Also available in: Unified diff