From a2bb24f03eb12b5745ff8680dc70c75c3a9983bb Mon Sep 17 00:00:00 2001 From: "R. Steve McKown" Date: Tue, 21 Sep 2010 11:04:24 -0600 Subject: [PATCH] Fix client immediateRequest() if S_IDLE and ResourceDefaultOwner releases. --- tos/system/SharedArbiterP.nc | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) 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() -- 2.39.2