From ad7a3b0fbb975e842df9fabf7b77ac4ebf3b4e77 Mon Sep 17 00:00:00 2001 From: klueska Date: Sun, 15 Apr 2007 20:05:03 +0000 Subject: [PATCH 1/1] Update to give warning about calling release before granted event comes back. If done, there is a potential race condition. --- tos/interfaces/Resource.nc | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) diff --git a/tos/interfaces/Resource.nc b/tos/interfaces/Resource.nc index 32346d20..09c847f5 100644 --- a/tos/interfaces/Resource.nc +++ b/tos/interfaces/Resource.nc @@ -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
* 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 + * release before receiving a granted event, + * we have opted to keep thing simple and warn you about the potential + * race. */ async command error_t release(); -- 2.39.2