Commit 76eb911a authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

sync: say that Cond.Wait can not return spuriously

R=golang-dev, r, rsc, remyoudompheng, r
CC=golang-dev
https://golang.org/cl/5674086
parent 649f771b
...@@ -43,9 +43,10 @@ func NewCond(l Locker) *Cond { ...@@ -43,9 +43,10 @@ func NewCond(l Locker) *Cond {
// Wait atomically unlocks c.L and suspends execution // Wait atomically unlocks c.L and suspends execution
// of the calling goroutine. After later resuming 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 // typically cannot assume that the condition is true when
// Wait returns. Instead, the caller should Wait in a loop: // Wait returns. Instead, the caller should Wait in a loop:
// //
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment