]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: correct Note documentation
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 3 Aug 2011 19:51:55 +0000 (15:51 -0400)
committerRuss Cox <rsc@golang.org>
Wed, 3 Aug 2011 19:51:55 +0000 (15:51 -0400)
Reflect the fact that notesleep() can be called
by exactly one thread.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/4816064

src/pkg/runtime/runtime.h

index 44511da8307eeb404c600170b0ed595baba12beb..434c82b95dd6e03b17d78a7e76ede99a6f4ed817 100644 (file)
@@ -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*);