• Guido Trotter's avatar
    Locking: add ssynchronized decorator · 42a999d1
    Guido Trotter authored
    This patch creates a new decorator function ssynchronized in the locking
    library, which takes as input a SharedLock, and synchronizes access to
    the decorated functions using it. The usual SharedLock semantics apply,
    so it's possible to call more than one synchronized function at the same
    time, when the lock is acquired in shared mode, and still protect
    against exclusive access.
    
    The patch also adds a few unit test to check the basic decorator's
    functionality, and to provide an example on how to use it.
    
    Reviewed-by: iustinp
    42a999d1
ganeti.locking_unittest.py 27.9 KB