]> Cypherpunks repositories - gostls13.git/commitdiff
sync: say that Cond.Wait can not return spuriously
authorDmitriy Vyukov <dvyukov@google.com>
Fri, 17 Feb 2012 09:20:11 +0000 (13:20 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Fri, 17 Feb 2012 09:20:11 +0000 (13:20 +0400)
R=golang-dev, r, rsc, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/5674086

src/pkg/sync/cond.go

index 75494b53536fb8b11bfe4498eed4dd84010b79fd..44f19fae3eeb9e33dcacfb5fe8db3cf29a61de84 100644 (file)
@@ -43,9 +43,10 @@ func NewCond(l Locker) *Cond {
 
 // Wait atomically unlocks c.L and suspends execution
 // of the calling goroutine.  After later resuming execution,
-// Wait locks c.L before returning.
+// Wait locks c.L before returning.  Unlike in other systems,
+// Wait cannot return unless awoken by Broadcast or Signal.
 //
-// Because L is not locked when Wait first resumes, the caller
+// Because c.L is not locked when Wait first resumes, the caller
 // typically cannot assume that the condition is true when
 // Wait returns.  Instead, the caller should Wait in a loop:
 //