From: R. Steve McKown Date: Tue, 21 Sep 2010 17:04:24 +0000 (-0600) Subject: Fix client immediateRequest() if S_IDLE and ResourceDefaultOwner releases. X-Git-Tag: release/2.1.1-4.4~3 X-Git-Url: https://oss.titaniummirror.com/gitweb/?p=tinyos-2.x.git;a=commitdiff_plain;h=a2bb24f03eb12b5745ff8680dc70c75c3a9983bb Fix client immediateRequest() if S_IDLE and ResourceDefaultOwner releases. --- diff --git a/tos/system/SharedArbiterP.nc b/tos/system/SharedArbiterP.nc index f13e03c2..aa926069 100644 --- a/tos/system/SharedArbiterP.nc +++ b/tos/system/SharedArbiterP.nc @@ -173,14 +173,11 @@ implementation { async command error_t ResourceDefaultOwner.release() { - atomic { - if (m_requesting > 0) { - call State.forceState(S_GRANTED); - post grantedTask(); - return SUCCESS; - } else - return FAIL; - } + if (call State.requestState(S_GRANTED) == SUCCESS) { + post grantedTask(); + return SUCCESS; + } else + return FAIL; } async command bool ArbiterInfo.inUse()