From: R. Steve McKown Date: Wed, 15 Sep 2010 18:44:11 +0000 (-0600) Subject: Conform SharedArbiterP better to TEP108. X-Git-Tag: release/2.1.1-4.4~7 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=517a91449b03531a02547ae840346474e7891f45 Conform SharedArbiterP better to TEP108. --- diff --git a/tos/system/SharedArbiterP.nc b/tos/system/SharedArbiterP.nc index c3503131..1228c2a1 100644 --- a/tos/system/SharedArbiterP.nc +++ b/tos/system/SharedArbiterP.nc @@ -128,8 +128,12 @@ implementation { async command error_t Resource.request[uint8_t id]() { + /* The Resource docs do not say what happens when a user calls + * Resource.request() after the resource has already been granted. We + * elect to call EBUSY, as if the request was still in process. + */ if (call RequestingVector.get(id) || call GrantedVector.get(id)) - return FAIL; + return EBUSY; addRequesting(id); if (call State.isIdle()) @@ -141,8 +145,12 @@ implementation { async command error_t Resource.immediateRequest[uint8_t id]() { + /* The Resource docs do not say what happens when a user calls + * Resource.request() after the resource has already been granted. We + * elect to call EBUSY, as if the request was still in process. + */ if (call RequestingVector.get(id) || call GrantedVector.get(id)) - return FAIL; + return EBUSY; if (call State.isIdle()) signal ResourceDefaultOwner.immediateRequested();