Skip to content

Commit

Permalink
🐶 Align some code comments
Browse files Browse the repository at this point in the history
  • Loading branch information
panjf2000 committed Jan 25, 2019
1 parent e099ad7 commit 4c0f9a4
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions examples/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ func main() {

runTimes := 1000

// Use the common pool
// Use the common pool.
var wg sync.WaitGroup
for i := 0; i < runTimes; i++ {
wg.Add(1)
Expand All @@ -63,13 +63,13 @@ func main() {
fmt.Printf("finish all tasks.\n")

// Use the pool with a function,
// set 10 to the size of goroutine pool and 1 second for expired duration
// set 10 to the size of goroutine pool and 1 second for expired duration.
p, _ := ants.NewPoolWithFunc(10, func(i interface{}) {
myFunc(i)
wg.Done()
})
defer p.Release()
// Submit tasks one by one
// Submit tasks one by one.
for i := 0; i < runTimes; i++ {
wg.Add(1)
p.Serve(int32(i))
Expand Down

0 comments on commit 4c0f9a4

Please sign in to comment.