Codebase list golang-github-vbauerster-mpb / 086f7ba
avoid panic, if Wait called more than once Vladimir Bauer 7 years ago
1 changed file(s) with 6 addition(s) and 1 deletion(s). Raw diff Collapse all Expand all
2929 operateState chan func(*pState)
3030 done chan struct{}
3131 forceRefresh chan time.Time
32 once sync.Once
3233 dlogger *log.Logger
3334 }
3435
204205 // wait for bars to quit, if any
205206 p.bwg.Wait()
206207
207 close(p.done)
208 p.once.Do(p.shutdown)
208209
209210 // wait for container to quit
210211 p.cwg.Wait()
212 }
213
214 func (p *Progress) shutdown() {
215 close(p.done)
211216 }
212217
213218 func (p *Progress) serve(s *pState, cw *cwriter.Writer) {