[Tinyos-devel] bug in ArbiterP.nc : Resource.release[uint8_t id]()

Kevin Klues klueska at gmail.com
Sat May 24 12:39:48 PDT 2008


Yeah, that was my fault. I rearranged some order of operations in
there last week and somehow accidentally removed the return of
SUCCESS.  Its back in there now.  Thanks.

Kevin

On Sat, May 24, 2008 at 7:57 AM, Aurélien Francillon
<aurelien.francillon at inrialpes.fr> wrote:
> Hi,
> There is a problem with the default Arbiter, the  Resource.release command
> always returns FAIL status, while it should return FAIL only if the
> component isn't granted the resource and success if it was owner of the
> resource cf Resource.nc:
>
>  * @return SUCCESS The resource has been released <br>
>  *         FAIL You tried to release but you are not the
>  *              owner of the resource
>
> while the Arbiter.nc resource.release code can only return FAIL :
>
>  async command error_t Resource.release[uint8_t id]() {
>    atomic {
>      if(state == RES_BUSY && resId == id) {
>        if(call Queue.isEmpty() == FALSE) {
>          reqResId = call Queue.dequeue();
>          state = RES_GRANTING;
>          post grantedTask();
>          call ResourceConfigure.unconfigure[id]();
>        }
>        else {
>          resId = default_owner_id;
>          state = RES_CONTROLLED;
>          call ResourceConfigure.unconfigure[id]();
>          signal ResourceDefaultOwner.granted();
>        }
>        // BUG: should return SUCCESS here
>      }
>    }
>    return FAIL;
>  }
>
> patch attached,
>
> Cheers
> Aurélien
>
>
> _______________________________________________
> Tinyos-devel mailing list
> Tinyos-devel at millennium.berkeley.edu
> https://www.millennium.berkeley.edu/cgi-bin/mailman/listinfo/tinyos-devel
>
>



-- 
~Kevin



More information about the Tinyos-devel mailing list