wait for user wg last
Vladimir Bauer
1 year, 10 months ago
| 224 | 224 | // Wait waits for all bars to complete and finally shutdowns container. After |
| 225 | 225 | // this method has been called, there is no way to reuse `*Progress` instance. |
| 226 | 226 | func (p *Progress) Wait() { |
| 227 | p.bwg.Wait() | |
| 228 | p.Shutdown() | |
| 227 | 229 | // wait for user wg, if any |
| 228 | 230 | if p.uwg != nil { |
| 229 | 231 | p.uwg.Wait() |
| 230 | 232 | } |
| 231 | ||
| 232 | p.bwg.Wait() | |
| 233 | p.Shutdown() | |
| 234 | 233 | } |
| 235 | 234 | |
| 236 | 235 | // Shutdown cancels any running bar immediately and then shutdowns `*Progress` |