]> oss.titaniummirror.com Git - tinyos-2.x.git/blobdiff - tos/system/SimpleArbiterP.nc
Merge TinyOS 2.1.1 into master.
[tinyos-2.x.git] / tos / system / SimpleArbiterP.nc
index 91d883a0bce74daf3b097ebe5d4437be276496be..30f185f2e99926602161b29f6652717f326437a4 100644 (file)
@@ -46,7 +46,7 @@
  * @author Philip Levis
  */
  
-generic module SimpleArbiterP() {
+generic module SimpleArbiterP() @safe() {
   provides {
     interface Resource[uint8_t id];
     interface ResourceRequested[uint8_t id];
@@ -99,6 +99,7 @@ implementation {
     atomic {
       if(state == RES_BUSY && resId == id) {
         if(call Queue.isEmpty() == FALSE) {
+          resId = NO_RES;
           reqResId = call Queue.dequeue();
           state = RES_GRANTING;
           post grantedTask();