[Tinyos-devel] Resource.isOwner() can return false information
Kevin Klues
klueska at gmail.com
Thu Aug 23 16:35:36 PDT 2007
Can you give a use case where this actually occurs? I understand your
concern... as well as your proposed solution,but as it is implemented
now, upon release 'resId' is either set to NO_RES in the case of
SimpleArbiters or the resource is handed over to its default owner in
the case of normal Arbiters. I'm not sure under what circumstances it
would falsely return TRUE.
Kevin
On 8/23/07, Roman Lim <rlim at ee.ethz.ch> wrote:
> Hi
> I just had a case, where I found a call to Resource.isOwner() returning
> TRUE, even when the Resource was just released.
>
> If there is a request pending while releasing the resource, resId does
> not get assigned another id immediately, but only when the granted task
> gets executed. A call to Resource.isOwner() between release and granted
> will therefore return true for the component that just released the
> resource, because isOwner just compares the id of the caller and the
> resId to determine the return value.
>
> I suggest to check the state of the arbiter in the isOwner() command,
> too and return true, if id==resId and state==RES_BUSY.
>
> Roman
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at Millennium.Berkeley.EDU
> https://mail.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
--
~Kevin
More information about the Tinyos-devel
mailing list