]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Fix client immediateRequest() if S_IDLE and ResourceDefaultOwner releases.
authorR. Steve McKown <rsmckown@gmail.com>
Tue, 21 Sep 2010 17:04:24 +0000 (11:04 -0600)
committerR. Steve McKown <rsmckown@gmail.com>
Tue, 21 Sep 2010 17:04:24 +0000 (11:04 -0600)
tos/system/SharedArbiterP.nc

index f13e03c2cc3cc503568d9e12864fca1e64d16e8e..aa9260693c5d39fc3c5205031034f3059885e699 100644 (file)
@@ -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()