new locking API

David Zeuthen david at fubar.dk
Mon Mar 26 17:33:32 PDT 2007


On Mon, 2007-03-26 at 21:44 +0200, Kevin Ottens wrote:
> Le Lundi 26 Mars 2007, David Zeuthen a écrit :
> > As Danny alluded to, there's a new locking API - and this time, one that
> > actually isn't just advisory locks; e.g. you can use this to prevent
> > automounters from mounting devices. I've also written docs for it (and
> > cleaned up most of the spec); see
> >
> >  http://people.freedesktop.org/~david/hal-spec/hal-spec.html#locking
> >
> > The code itself is in master
> >
> >  http://gitweb.freedesktop.org/?p=hal.git
> >
> > Comments / questions on both the docs/code welcome. Thanks.
> 
> I've one question, why locking per interface? Why not locking per device?
> It's not exactly obvious for me, I would feel natural to lock a device.

Because one device object might have several interfaces and on one
system you may see

 device object A
  implements interface Foo
  implements interface Bar

while another system shows

 device object A
  implements interface Foo

 device object B
  implements interface Bar

depending on many factors including how the interfaces are implemented
and so on. So if the lock affected the entire device object you would
have weird side effects because now you've rendered the Bar interface
inoperable while you only really intended to lock Foo.

> Other than that, I like the new semantic of those locks. Nice work.

Thanks!

     David




More information about the hal mailing list