]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Added patch to DeferredPowerManager to check for EALREADY when starting or stopping...
authorklueska <klueska>
Mon, 2 Mar 2009 21:05:10 +0000 (21:05 +0000)
committerklueska <klueska>
Mon, 2 Mar 2009 21:05:10 +0000 (21:05 +0000)
tos/lib/power/DeferredPowerManagerP.nc

index 250042cee03e3ff41a48bc5126890d4c8619c033..209b5ffcbad38767825644d862454b77ac431a87 100644 (file)
@@ -70,7 +70,8 @@ implementation {
     call TimerMilli.stop();
     stopTimer = FALSE;
     call StdControl.start();
-    call SplitControl.start();
+    if (call SplitControl.start()==EALREADY)
+      call ResourceDefaultOwner.release();
   }
 
   task void timerTask() { 
@@ -82,7 +83,7 @@ implementation {
       stopTimer = TRUE;
       post startTask();
     }
-    else atomic requested = TRUE;
+    else requested = TRUE;
   }
 
   async event void ResourceDefaultOwner.immediateRequested() {
@@ -105,11 +106,14 @@ implementation {
   }
 
   event void TimerMilli.fired() {
-    if(stopTimer == FALSE) {
-      stopping = TRUE;
-      call PowerDownCleanup.cleanup();
-      call StdControl.stop();
-      call SplitControl.stop();
+    atomic {
+      if(stopTimer == FALSE) {
+        stopping = TRUE;
+        call PowerDownCleanup.cleanup();
+        call StdControl.stop();
+        if (call SplitControl.stop()==EALREADY)
+          signal SplitControl.stopDone(SUCCESS);
+      }
     }
   }