mirror of
https://github.com/golang/go
synced 2024-11-22 03: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:
parent
649f771b7b
commit
76eb911a3c
@ -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:
|
||||
//
|
||||
|
Loading…
Reference in New Issue
Block a user