Codebase list golang-github-vbauerster-mpb / d8ed1db
wg.Add len of decorators Vladimir Bauer 1 year, 10 months ago
1 changed file(s) with 3 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
580580 }
581581
582582 func (s bState) decoratorEwmaUpdate(n int64, dur time.Duration, wg *sync.WaitGroup) {
583 wg.Add(len(s.ewmaDecorators))
583584 for _, d := range s.ewmaDecorators {
584 wg.Add(1)
585585 d := d
586586 go func() {
587587 d.EwmaUpdate(n, dur)
591591 }
592592
593593 func (s bState) decoratorAverageAdjust(start time.Time, wg *sync.WaitGroup) {
594 wg.Add(len(s.averageDecorators))
594595 for _, d := range s.averageDecorators {
595 wg.Add(1)
596596 d := d
597597 go func() {
598598 d.AverageAdjust(start)
602602 }
603603
604604 func (s bState) decoratorShutdownNotify(wg *sync.WaitGroup) {
605 wg.Add(len(s.shutdownListeners))
605606 for _, d := range s.shutdownListeners {
606 wg.Add(1)
607607 d := d
608608 go func() {
609609 d.OnShutdown()