[Tinyos-2-commits] CVS: tinyos-2.x/tos/interfaces Resource.nc, 1.4,
1.5
Kevin Klues
klueska at users.sourceforge.net
Sun Apr 15 13:05:07 PDT 2007
Update of /cvsroot/tinyos/tinyos-2.x/tos/interfaces
In directory sc8-pr-cvs10.sourceforge.net:/tmp/cvs-serv20716
Modified Files:
Resource.nc
Log Message:
Update to give warning about calling release before granted event comes back. If done, there is a potential race condition.
Index: Resource.nc
===================================================================
RCS file: /cvsroot/tinyos/tinyos-2.x/tos/interfaces/Resource.nc,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** Resource.nc 12 Dec 2006 18:23:15 -0000 1.4
--- Resource.nc 15 Apr 2007 20:05:03 -0000 1.5
***************
*** 93,101 ****
/**
! * 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
*/
async command error_t release();
--- 93,110 ----
/**
! * 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();
More information about the Tinyos-2-commits
mailing list