bar.Aborted method
Vladimir Bauer
4 years ago
| 291 | 291 | } |
| 292 | 292 | } |
| 293 | 293 | |
| 294 | // Aborted reports whether the bar is in aborted state. | |
| 295 | func (b *Bar) Aborted() bool { | |
| 296 | result := make(chan bool) | |
| 297 | select { | |
| 298 | case b.operateState <- func(s *bState) { result <- s.aborted }: | |
| 299 | return <-result | |
| 300 | case <-b.done: | |
| 301 | return b.bs.aborted | |
| 302 | } | |
| 303 | } | |
| 304 | ||
| 294 | 305 | // Completed reports whether the bar is in completed state. |
| 295 | 306 | func (b *Bar) Completed() bool { |
| 296 | 307 | result := make(chan bool) |