From: Dmitriy Vyukov Date: Fri, 17 Feb 2012 09:20:11 +0000 (+0400) Subject: sync: say that Cond.Wait can not return spuriously X-Git-Tag: weekly.2012-02-22~155 X-Git-Url: http://www.git.cypherpunks.su/?a=commitdiff_plain;h=76eb911a3ccb386bc94f13f491ec78caa42a2bf7;p=gostls13.git sync: say that Cond.Wait can not return spuriously R=golang-dev, r, rsc, remyoudompheng, r CC=golang-dev https://golang.org/cl/5674086 --- diff --git a/src/pkg/sync/cond.go b/src/pkg/sync/cond.go index 75494b5353..44f19fae3e 100644 --- a/src/pkg/sync/cond.go +++ b/src/pkg/sync/cond.go @@ -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: //