[Telepathy] Uniqueness of objects

Dafydd Harries dafydd.harries at collabora.co.uk
Thu Oct 2 06:59:04 PDT 2008


Ar 01/10/2008 am 14:55, ysgrifennodd Xavier Claessens:
> On mer, 2008-10-01 at 13:21 +0100, Simon McVittie wrote:
> > On Wed, 01 Oct 2008 at 07:24:58 +0200, Xavier Claessens wrote:
> > > The spec doesn't say exactly
> > > what happens if ReleaseHandle is called more than once
> > 
> > The spec does (or should) say that HoldHandle is idempotent, i.e. one
> > call is equivalent to many calls. The intention and implementation is
> > that whether a client :1.42 is holding handle 123 is binary - either it
> > is or it isn't. So however many times :1.42 calls HoldHandle or
> > RequestHandles, it only has one reference to handle 123, and
> > ReleaseHandles([123]) is sufficient to release that reference.
> 
> Sure, but what happens if I call ReleaseHandles 2 times? The first time
> the handle was Hold, so it's OK. The 2nd there is 2 possibilities:
> 1) The handle is already destroyed and I guess I get an error like
> "invalid handle". 2) The handle is still hold by a channel or another
> process, in that case the spec is not clear, what happens? The CM
> silently ignore the call? An error is returned?

You get an error because you don't hold a reference to that handle.

What's the problem with doing reference counting on the client side, and
mapping the 0->1 refs boundary to HoldHandles and the 1->0 refs boundary to
ReleaseHandles?

-- 
Dafydd


More information about the Telepathy mailing list