Skip to content

Commit 024b0b7

Browse files
Fixed comments
1 parent 2a1ee90 commit 024b0b7

2 files changed

Lines changed: 4 additions & 4 deletions

File tree

chapter7/patterns/pool/pool.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ func (p *Pool) Close() {
9292
return
9393
}
9494

95-
// Toggle the flag
95+
// Set the pool as closed.
9696
p.closed = true
9797

9898
// Close the channel before we drain the channel of its

chapter7/patterns/work/work.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,13 +20,13 @@ type Pool struct {
2020
}
2121

2222
// New creates a new work pool.
23-
func New(goroutines int) *Pool {
23+
func New(maxGoroutines int) *Pool {
2424
p := Pool{
2525
work: make(chan Worker),
2626
}
2727

28-
p.wg.Add(goroutines)
29-
for i := 0; i < goroutines; i++ {
28+
p.wg.Add(maxGoroutines)
29+
for i := 0; i < maxGoroutines; i++ {
3030
go func() {
3131
for w := range p.work {
3232
w.Task()

0 commit comments

Comments
 (0)