LockSet: forbid add() on a partially owned set
authorGuido Trotter <ultrotter@google.com>
Thu, 11 Sep 2008 09:44:08 +0000 (09:44 +0000)
committerGuido Trotter <ultrotter@google.com>
Thu, 11 Sep 2008 09:44:08 +0000 (09:44 +0000)
commitd2aff862c9b9974f2a9d345ddbbcc6baad76f87b
tree1a64d037cbfd6a417710e2d22e259087079db5e5
parentab62526cf24860240f54ffaaa95844a1fd34345c
LockSet: forbid add() on a partially owned set

This patch bans add() on a half-acquired set. This behavior was
previously possible, but created a deadlock if someone tried to acquire
the set-lock in the meantime, and thus is now forbidden. The
testAddRemove unit test is fixed for this new behavior, and includes a
few more lines of testing and a new testConcurrentSetLockAdd function
tests its behavior in the concurrent case.

Reviewed-by: imsnah
lib/locking.py
test/ganeti.locking_unittest.py