]> oss.titaniummirror.com Git - tinyos-2.x.git/commitdiff
Update to give warning about calling release before granted event comes back. If...
authorklueska <klueska>
Sun, 15 Apr 2007 20:05:03 +0000 (20:05 +0000)
committerklueska <klueska>
Sun, 15 Apr 2007 20:05:03 +0000 (20:05 +0000)
tos/interfaces/Resource.nc

index 32346d2028be6f0e37581044d683c8a7e37804d4..09c847f5c1e22610e8cb5d81b1b59d97950f9770 100644 (file)
@@ -92,11 +92,20 @@ interface Resource {
   event void granted();
    
   /**
-  * Release a shared resource you previously acquired.
+  * Release a shared resource you previously acquired.  
   *
   * @return SUCCESS The resource has been released <br>
   *         FAIL You tried to release but you are not the
   *              owner of the resource 
+  *
+  * @note This command should never be called between putting in a request       
+  *       and waiting for a granted event.  Doing so will result in a
+  *       potential race condition.  There are ways to guarantee that no
+  *       race will occur, but they are clumsy and overly complicated.
+  *       Since it doesn't logically make since to be calling
+  *       <code>release</code> before receiving a <code>granted</code> event, 
+  *       we have opted to keep thing simple and warn you about the potential 
+  *       race.
   */
   async command error_t release();