X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=tos%2Fsystem%2FSharedArbiterP.nc;h=aa9260693c5d39fc3c5205031034f3059885e699;hb=a2bb24f03eb12b5745ff8680dc70c75c3a9983bb;hp=f13e03c2cc3cc503568d9e12864fca1e64d16e8e;hpb=d4c52892c730e2f5cb6c4c483adc39097742faea;p=tinyos-2.x.git 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()