Revision 5bbd3f7f lib/locking.py
b/lib/locking.py | ||
---|---|---|
297 | 297 |
|
298 | 298 |
|
299 | 299 |
# Whenever we want to acquire a full LockSet we pass None as the value |
300 |
# to acquire. Hide this behing this nicely named constant.
|
|
300 |
# to acquire. Hide this behind this nicely named constant.
|
|
301 | 301 |
ALL_SET = None |
302 | 302 |
|
303 | 303 |
|
... | ... | |
689 | 689 |
class GanetiLockManager: |
690 | 690 |
"""The Ganeti Locking Library |
691 | 691 |
|
692 |
The purpouse of this small library is to manage locking for ganeti clusters
|
|
692 |
The purpose of this small library is to manage locking for ganeti clusters |
|
693 | 693 |
in a central place, while at the same time doing dynamic checks against |
694 | 694 |
possible deadlocks. It will also make it easier to transition to a different |
695 | 695 |
lock type should we migrate away from python threads. |
... | ... | |
774 | 774 |
"""Acquire a set of resource locks, at the same level. |
775 | 775 |
|
776 | 776 |
@param level: the level at which the locks shall be acquired; |
777 |
it must be a memmber of LEVELS.
|
|
777 |
it must be a member of LEVELS. |
|
778 | 778 |
@param names: the names of the locks which shall be acquired |
779 | 779 |
(special lock names, or instance/node names) |
780 | 780 |
@param shared: whether to acquire in shared mode; by default |
... | ... | |
809 | 809 |
mode, before releasing them. |
810 | 810 |
|
811 | 811 |
@param level: the level at which the locks shall be released; |
812 |
it must be a memmber of LEVELS
|
|
812 |
it must be a member of LEVELS |
|
813 | 813 |
@param names: the names of the locks which shall be released |
814 | 814 |
(defaults to all the locks acquired at that level) |
815 | 815 |
|
... | ... | |
827 | 827 |
"""Add locks at the specified level. |
828 | 828 |
|
829 | 829 |
@param level: the level at which the locks shall be added; |
830 |
it must be a memmber of LEVELS_MOD.
|
|
830 |
it must be a member of LEVELS_MOD. |
|
831 | 831 |
@param names: names of the locks to acquire |
832 | 832 |
@param acquired: whether to acquire the newly added locks |
833 | 833 |
@param shared: whether the acquisition will be shared |
Also available in: Unified diff