[Tinyos-devel] Resource.isOwner() can return false information

Roman Lim rlim at ee.ethz.ch
Thu Aug 23 09:24:42 PDT 2007


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


More information about the Tinyos-devel mailing list