Codebase list golang-github-vbauerster-mpb / b1d0fee
skip abort if bar already in completed state Vladimir Bauer 4 years ago
1 changed file(s) with 6 addition(s) and 3 deletion(s). Raw diff Collapse all Expand all
262262 b.container.setBarPriority(b, priority)
263263 }
264264
265 // Abort interrupts bar's running goroutine. Call this, if you'd like
266 // to stop/remove bar before completion event. It has no effect after
267 // completion event. If drop is true bar will be removed as well.
265 // Abort interrupts bar's running goroutine. Abort won't be engaged
266 // if bar is already in complete state. If drop is true bar will be
267 // removed as well.
268268 func (b *Bar) Abort(drop bool) {
269 if b.Completed() {
270 return
271 }
269272 select {
270273 case <-b.done:
271274 default: