From 975a4defadb47ec8d3d6156f3eb20f6a67ec3009 Mon Sep 17 00:00:00 2001 From: David Zeuthen Date: Sat, 31 Mar 2007 18:07:59 -0400 Subject: change locking semantics a bit and add guidelines for SystemPowerManagement The change in locking semantics is that a lock-holder can now access a device even if other processes have locks on the device. --- examples/interface-locking-test.py | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'examples') diff --git a/examples/interface-locking-test.py b/examples/interface-locking-test.py index 3b98cd1f..ca60a910 100755 --- a/examples/interface-locking-test.py +++ b/examples/interface-locking-test.py @@ -17,9 +17,16 @@ device = dbus.Interface(bus.get_object("org.freedesktop.Hal", "/org/freedesktop/Hal/devices/volume_uuid_2232_1F11"), "org.freedesktop.Hal.Device") -manager.AcquireGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage", True) -#device.AcquireInterfaceLock("org.freedesktop.Hal.Device.Volume", True) +device_volume = dbus.Interface(bus.get_object("org.freedesktop.Hal", + "/org/freedesktop/Hal/devices/volume_uuid_2232_1F11"), + "org.freedesktop.Hal.Device.Volume") + +#manager.AcquireGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage", True) +#time.sleep(2) +#manager.ReleaseGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage") + +device.AcquireInterfaceLock("org.freedesktop.Hal.Device.Volume", False) +device_volume.Mount("", "", []) time.sleep(2) -manager.ReleaseGlobalInterfaceLock("org.freedesktop.Hal.Device.Storage") -#device.ReleaseInterfaceLock("org.freedesktop.Hal.Device.Volume") +device.ReleaseInterfaceLock("org.freedesktop.Hal.Device.Volume") -- cgit v1.2.3