new locking API

Kevin Ottens ervin at kde.org
Tue Mar 27 10:29:21 PDT 2007


Le Mardi 27 Mars 2007, David Zeuthen a écrit :
> On Tue, 2007-03-27 at 19:00 +0200, Kevin Ottens wrote:
> > Ok, maybe that's just me being paranoid here. But depending how a device
> > is done, aren't we at risk if we lock it only partly, two interfaces
> > could be non orthogonal in their behavior.
>
> If that's the case, then it's a bug that the latter interface don't
> check on locks from other interfaces. This is all fine and intentional;
> an interface may want to track locks on other interfaces and even other
> device objects (e.g. the Volume locks track the Storage lock on the
> originating storage device).

Ok, that's fine with me then. Maybe that's a point to clarify in the spec 
though? It wasn't that obvious to me, moreover that means that this kind of 
behavior will have to be described on a case by case basis for each possible 
interface.

> > Actually could be the case already with Volume.Crypto and Volume. If I
> > lock the Volume interface I have to check each time if it also implements
> > the Volume.Crypto interface to lock it too. Otherwise, one could
> > perfectly call Teardown on it despite the lock on the Volume interface. A
> > good way to shoot easily in your own foot IMO.
>
> Funny you should mention this; I fixed that last night
>
> http://gitweb.freedesktop.org/?p=hal.git;a=commitdiff;h=28fc2fa7c6bbde540d4
>f17e810ab59fda0c186ba

Hehe, /me releases lock on the mind reading device.

Regards.
-- 
Kévin 'ervin' Ottens, http://ervin.ipsquad.net
"Ni le maître sans disciple, Ni le disciple sans maître,
Ne font reculer l'ignorance."
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: not available
Url : http://lists.freedesktop.org/archives/hal/attachments/20070327/38992f49/attachment.pgp


More information about the hal mailing list