From 517a91449b03531a02547ae840346474e7891f45 Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Wed, 15 Sep 2010 12:44:11 -0600 Subject: [PATCH] Conform SharedArbiterP better to TEP108. --- tos/system/SharedArbiterP.nc | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) 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(); -- 2.39.2