summaryrefslogtreecommitdiff
path: root/examples
diff options
context:
space:
mode:
authorDavid Zeuthen <davidz@redhat.com>2007-03-31 22:37:48 -0400
committerDavid Zeuthen <davidz@redhat.com>2007-03-31 22:37:48 -0400
commit4a36ab4a5c0b0b9b9c7e593e8d227af99cd3a5dc (patch)
tree9d5119c70ec138212780bb2d9d4ac5cc559329b4 /examples
parent975a4defadb47ec8d3d6156f3eb20f6a67ec3009 (diff)
change locking semantics slightly and add missing locking bits
Diffstat (limited to 'examples')
-rwxr-xr-xexamples/interface-locking-test.py10
1 files changed, 7 insertions, 3 deletions
diff --git a/examples/interface-locking-test.py b/examples/interface-locking-test.py
index ca60a910..51552b4c 100755
--- a/examples/interface-locking-test.py
+++ b/examples/interface-locking-test.py
@@ -22,11 +22,15 @@ device_volume = dbus.Interface(bus.get_object("org.freedesktop.Hal",
"org.freedesktop.Hal.Device.Volume")
#manager.AcquireGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage", True)
-#time.sleep(2)
+#time.sleep(10)
#manager.ReleaseGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage")
device.AcquireInterfaceLock("org.freedesktop.Hal.Device.Volume", False)
-device_volume.Mount("", "", [])
-time.sleep(2)
+#device_volume.Mount("", "", [])
+if device.IsLockedByOthers("org.freedesktop.Hal.Device.Volume"):
+ print "device is locked by another process too!"
+else:
+ print "we are the only process locking the device"
+time.sleep(10)
device.ReleaseInterfaceLock("org.freedesktop.Hal.Device.Volume")