]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/ArbiterP.nc
Inserted a check into Resource.request() that controls if the current caller id has...
[tinyos-2.x.git] / tos / system / ArbiterP.nc
index f7b2fcedab33f221b78ada452ab1a10c46efed2f..bf66c2c58d047c6636fc5df0e505fbd38bd8261b 100644 (file)
@@ -81,6 +81,9 @@ implementation {
         state = RES_GRANTING;
         reqResId = id;
       }
+      else if (reqResId == id) {
+       return SUCCESS;
+      }
       else return call Queue.enqueue(id);
     }
     signal ResourceDefaultOwner.requested();
@@ -110,6 +113,7 @@ implementation {
       if(state == RES_BUSY && resId == id) {
         if(call Queue.isEmpty() == FALSE) {
           reqResId = call Queue.dequeue();
+          resId = NO_RES;
           state = RES_GRANTING;
           post grantedTask();
           call ResourceConfigure.unconfigure[id]();