1
0
mirror of https://github.com/golang/go synced 2024-11-21 21:34:40 -07:00

sync: say that Cond.Wait can not return spuriously

R=golang-dev, r, rsc, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/5674086
This commit is contained in:
Dmitriy Vyukov 2012-02-17 13:20:11 +04:00
parent 649f771b7b
commit 76eb911a3c

View 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:
//