Codebase list golang-github-vbauerster-mpb / 84cb224
no need for barPopQueue Vladimir Bauer 5 years ago
1 changed file(s) with 4 addition(s) and 15 deletion(s). Raw diff Collapse all Expand all
4040 pMatrix map[int][]chan int
4141 aMatrix map[int][]chan int
4242 barShutdownQueue []*Bar
43 barPopQueue []*Bar
4443
4544 // following are provided/overrided by user
4645 idCount int
301300 delete(s.parkedBars, b)
302301 b.toDrop = true
303302 }
303 if s.popCompleted && !b.noPop {
304 lineCount -= b.extendedLines + 1
305 b.toDrop = true
306 }
304307 if b.toDrop {
305308 delete(bm, b)
306 s.heapUpdated = true
307 } else if s.popCompleted {
308 if b := b; !b.noPop {
309 defer func() {
310 s.barPopQueue = append(s.barPopQueue, b)
311 }()
312 }
313309 }
314310 b.cancel()
315311 }
316312 s.barShutdownQueue = s.barShutdownQueue[0:0]
317
318 for _, b := range s.barPopQueue {
319 delete(bm, b)
320 s.heapUpdated = true
321 lineCount -= b.extendedLines + 1
322 }
323 s.barPopQueue = s.barPopQueue[0:0]
324313
325314 for b := range bm {
326315 heap.Push(&s.bHeap, b)