Package ganeti :: Module locking
[hide private]
[frames] | no frames]

Module locking

source code

Module implementing the Ganeti locking code.

Classes [hide private]
  SharedLock
Implements a shared lock.
  LockSet
Implements a set of locks.
  GanetiLockManager
The Ganeti Locking Library
Functions [hide private]
 
ssynchronized(lock, shared=0)
Shared Synchronization decorator.
source code
Variables [hide private]
  ALL_SET = None
  LEVEL_CLUSTER = 0
  LEVEL_INSTANCE = 1
  LEVEL_NODE = 2
  LEVELS = [LEVEL_CLUSTER, LEVEL_INSTANCE, LEVEL_NODE]
  LEVELS_MOD = [LEVEL_NODE, LEVEL_INSTANCE]
  BGL = 'BGL'

Imports: threading, errors, utils


Function Details [hide private]

ssynchronized(lock, shared=0)

source code 

Shared Synchronization decorator.

Calls the function holding the given lock, either in exclusive or shared mode. It requires the passed lock to be a SharedLock (or support its semantics).