Codebase list golang-github-vbauerster-mpb / 8d4ace4
better var name Vladimir Bauer 4 years ago
2 changed file(s) with 7 addition(s) and 7 deletion(s). Raw diff Collapse all Expand all
137137
138138 // TraverseDecorators traverses all available decorators and calls cb func on each.
139139 func (b *Bar) TraverseDecorators(cb func(decor.Decorator)) {
140 done := make(chan struct{})
140 sync := make(chan struct{})
141141 select {
142142 case b.operateState <- func(s *bState) {
143143 for _, decorators := range [...][]decor.Decorator{
148148 cb(extractBaseDecorator(d))
149149 }
150150 }
151 close(done)
152 }:
153 <-done
151 close(sync)
152 }:
153 <-sync
154154 case <-b.done:
155155 }
156156 }
135135 }
136136
137137 func (p *Progress) traverseBars(cb func(b *Bar) bool) {
138 done := make(chan struct{})
138 sync := make(chan struct{})
139139 select {
140140 case p.operateState <- func(s *pState) {
141141 for i := 0; i < s.bHeap.Len(); i++ {
144144 break
145145 }
146146 }
147 close(done)
147 close(sync)
148148 }:
149 <-done
149 <-sync
150150 case <-p.done:
151151 }
152152 }