aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2011-08-03 15:51:55 -0400
committerRuss Cox <rsc@golang.org>2011-08-03 15:51:55 -0400
commita496c9eaa62a5456dbb53502c186193c0528440f (patch)
tree6f6dca024a20b1afe50b898ea3ba5479dd78b696
parentb32e2105866c3d43c522123ef6d63da7578fb3da (diff)
downloadgo-a496c9eaa62a5456dbb53502c186193c0528440f.tar.gz
go-a496c9eaa62a5456dbb53502c186193c0528440f.zip
runtime: correct Note documentation
Reflect the fact that notesleep() can be called by exactly one thread. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/4816064
-rw-r--r--src/pkg/runtime/runtime.h9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/pkg/runtime/runtime.h b/src/pkg/runtime/runtime.h
index 44511da830..434c82b95d 100644
--- a/src/pkg/runtime/runtime.h
+++ b/src/pkg/runtime/runtime.h
@@ -521,10 +521,13 @@ void runtime·destroylock(Lock*);
* sleep and wakeup on one-time events.
* before any calls to notesleep or notewakeup,
* must call noteclear to initialize the Note.
- * then, any number of threads can call notesleep
+ * then, exactly one thread can call notesleep
* and exactly one thread can call notewakeup (once).
- * once notewakeup has been called, all the notesleeps
- * will return. future notesleeps will return immediately.
+ * once notewakeup has been called, the notesleep
+ * will return. future notesleep will return immediately.
+ * subsequent noteclear must be called only after
+ * previous notesleep has returned, e.g. it's disallowed
+ * to call noteclear straight after notewakeup.
*/
void runtime·noteclear(Note*);
void runtime·notesleep(Note*);