mirror of
https://github.com/golang/go.git
synced 2025-12-08 06:10:04 +00:00
sync: update comments for Once.done
Sync with CL 666895.
Change-Id: I49c4a7f88d87cee9c30a858facd3cd8348efdf94
GitHub-Last-Rev: 88ac1c9c41
GitHub-Pull-Request: golang/go#76026
Reviewed-on: https://go-review.googlesource.com/c/go/+/714360
LUCI-TryBot-Result: Go LUCI <golang-scoped@luci-project-accounts.iam.gserviceaccount.com>
Auto-Submit: Jorropo <jorropo.pgm@gmail.com>
Reviewed-by: Michael Knyszek <mknyszek@google.com>
Reviewed-by: David Chase <drchase@google.com>
Reviewed-by: Jorropo <jorropo.pgm@gmail.com>
This commit is contained in:
parent
5dcaf9a01b
commit
f527994c61
1 changed files with 1 additions and 1 deletions
|
|
@ -52,7 +52,7 @@ type Once struct {
|
|||
func (o *Once) Do(f func()) {
|
||||
// Note: Here is an incorrect implementation of Do:
|
||||
//
|
||||
// if o.done.CompareAndSwap(0, 1) {
|
||||
// if o.done.CompareAndSwap(false, true) {
|
||||
// f()
|
||||
// }
|
||||
//
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue