mirror of
https://github.com/golang/go
synced 2024-11-22 04:14:42 -07:00
sync: remove old WaitGroup example
The docs look awkward - there is a paragraph "For example:" with a plain text example, and straight below it a real Example. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5717048
This commit is contained in:
parent
b03a5f66e8
commit
986df83e0d
@ -11,21 +11,6 @@ import "sync/atomic"
|
||||
// goroutines to wait for. Then each of the goroutines
|
||||
// runs and calls Done when finished. At the same time,
|
||||
// Wait can be used to block until all goroutines have finished.
|
||||
//
|
||||
// For example:
|
||||
//
|
||||
// for i := 0; i < n; i++ {
|
||||
// if !condition(i) {
|
||||
// continue
|
||||
// }
|
||||
// wg.Add(1)
|
||||
// go func() {
|
||||
// // Do something.
|
||||
// wg.Done()
|
||||
// }()
|
||||
// }
|
||||
// wg.Wait()
|
||||
//
|
||||
type WaitGroup struct {
|
||||
m Mutex
|
||||
counter int32
|
||||
|
Loading…
Reference in New Issue
Block a user