| Branch: | Tag: | Revision:

root / lib / @ cdb08f44

History | View | Annotate | Download (27.6 kB)

# Date Author Comment
cdb08f44 03/04/2008 04:46 pm Michael Hanselmann

Codestyle updates for locking code

Reviewed-by: ultrotter

3b7ed473 03/04/2008 03:18 pm Guido Trotter

LockSet: make acquire() able to get the whole set

This new functionality makes it possible to acquire a whole set, by passing
"None" to the acquire() function as the list of elements. This will avoid new
additions to the set, and then acquire all the current elements. The list of...

806e20fd 03/04/2008 03:18 pm Guido Trotter

LockSet: encapsulate acquire() in try-except

This patch adds a try/except area around most of the acquire() code (everything
after the intial condition checks). Since the except: clause contains just a
'raise' nothing really changes except the indentation of the code....

0cf257c5 03/04/2008 03:17 pm Guido Trotter

Make LockSet.__names() return a list, not a set

Previously the private version of the __names function returned directly a set.
We'll keep this in the public interface but change the private version to a
list in order to be able to sort() its result and then loop on it, even though...

3f404fc5 03/04/2008 03:17 pm Guido Trotter

LockSet: improve remove() api

Lockset's remove() function used to return a list of locks we failed to remove.
Rather than doing this we'll return a list of removed locks, so it's more
similar to how acquire() behaves. This patch also fixes the relevant unit tests....

0cc00929 03/04/2008 03:17 pm Guido Trotter

LockSet: make acquire() return the set of names

In a LockSet acquire() returned True on success. This code changes that to
return a set containing the names of the elements acquired. This is still a
true value if we acquired any lock but is slightly more useful (because if...

8b68f394 03/04/2008 03:16 pm Guido Trotter

LockSet: invert try/for nesting in acquire()

This patch changes nothing to the functionality of a LockSet. Rather than
trying to do the whole for loop we try each of its steps. This opens the way to
handle differently a single failure.

Reviewed-by: imsnah

7ee7c0c7 03/04/2008 12:09 pm Guido Trotter

Initial GanetiLockManager implementation

Includes some locking-related constants and explanations on how the
LockManager should be used, the class itself and its test cases.

The class includes:
- a basic constructor
- functions to acquire and release lists of locks at the same level...

e6c200d6 02/28/2008 08:53 pm Guido Trotter

LockSet: make acquire() fail faster on wrong locks

This patch makes acquire() first look up all the locks in the dict and then try
to acquire them later. The advantage is that if a lockname is already wrong
since the beginning we won't need to first queue and acquire other locks to...

aaae9bc0 02/28/2008 05:06 pm Guido Trotter

LockSet implementation and unit tests

A LockSet represents locking for a set of resources of the same type. A thread
can acquire multiple resources at the same time, and release some or all of
them, but cannot acquire more resources incrementally at different times...

a95fd5d7 02/19/2008 03:50 pm Guido Trotter

Add the delete() operation to SharedLock

This new operation lets a lock be cleanly deleted. The lock will be exclusively
held before deletion, and after it pending and future acquires will raise an
exception. Other SharedLock operations are modify to deal with delete() and to...

d6646186 02/18/2008 06:58 pm Guido Trotter

Fix a couple of SharedLock docstrings

Use the actual class name rather than a spaced version of it.

Reviewed-by: iustinp

162c1c1f 02/08/2008 01:23 pm Guido Trotter

Shared Lock implementation and unit tests.

Adding a file for the ganeti locking library. Its first component is
the implementation of a non-recursive blocking shared lock complete with a
testing library.

Reviewed-by: imsnah, iustinp