Skip to content

Commit

Permalink
data race
Browse files Browse the repository at this point in the history
  • Loading branch information
xxjwxc committed Dec 31, 2019
1 parent 65070a4 commit 1c04538
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions workpool/workpool.go
Original file line number Diff line number Diff line change
Expand Up @@ -57,8 +57,7 @@ func (p *WorkPool) DoWait(task TaskHandler) { // 添加到工作池,并等待
func (p *WorkPool) Wait() error { // 等待工作线程执行结束
p.waitingQueue.Wait() // 等待队列结束
p.waitTask() // wait que down
// close(p.task)
p.wg.Wait() // 等待结束
p.wg.Wait() // 等待结束
select {
case err := <-p.errChan:
return err
Expand Down Expand Up @@ -106,6 +105,7 @@ func (p *WorkPool) waitTask() {
break
}
}
close(p.task)
}

func (p *WorkPool) loop(maxWorkersCount int) {
Expand Down

0 comments on commit 1c04538

Please sign in to comment.