mirror of
https://github.com/golang/go
synced 2024-11-26 03:47:57 -07:00
sync: clarify Cond.Wait documentation
The previous wording was unclear and seemingly contradictory.
Change-Id: I0781dc4525948f4e8e5698271362a82387688f81
GitHub-Last-Rev: c1e032fa94
GitHub-Pull-Request: golang/go#53516
Reviewed-on: https://go-review.googlesource.com/c/go/+/413774
Reviewed-by: Ian Lance Taylor <iant@google.com>
TryBot-Result: Gopher Robot <gobot@golang.org>
Reviewed-by: Dmitri Shuralyov <dmitshur@google.com>
Auto-Submit: Ian Lance Taylor <iant@google.com>
Run-TryBot: Ian Lance Taylor <iant@google.com>
This commit is contained in:
parent
07bdf1dc54
commit
b8d8c9e79f
@ -53,7 +53,7 @@ func NewCond(l Locker) *Cond {
|
||||
// Wait locks c.L before returning. Unlike in other systems,
|
||||
// Wait cannot return unless awoken by Broadcast or Signal.
|
||||
//
|
||||
// Because c.L is not locked when Wait first resumes, the caller
|
||||
// Because c.L is not locked while Wait is waiting, 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