Show locksets in lock monitor
authorMichael Hanselmann <hansmi@google.com>
Fri, 6 May 2011 15:37:08 +0000 (17:37 +0200)
committerMichael Hanselmann <hansmi@google.com>
Mon, 9 May 2011 15:34:00 +0000 (17:34 +0200)
When all locks contained in a set are acquired, the lockset's internal
lock is acquired with the same mode. With this patch the internal lock
will show up on the lock monitor, named e.g. “instances/[lockset]”.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Guido Trotter <ultrotter@google.com>

lib/locking.py

index 5ac9ebe..5eb2c99 100644 (file)
@@ -855,8 +855,8 @@ class LockSet:
     # Lock monitor
     self.__monitor = monitor
 
-    # Used internally to guarantee coherency.
-    self.__lock = SharedLock(name)
+    # Used internally to guarantee coherency
+    self.__lock = SharedLock(self._GetLockName("[lockset]"), monitor=monitor)
 
     # The lockdict indexes the relationship name -> lock
     # The order-of-locking is implied by the alphabetical order of names