diff --git a/bar.go b/bar.go index 03fa65d..ad55067 100644 --- a/bar.go +++ b/bar.go @@ -31,14 +31,15 @@ priority int index int - // the flag is set from Progress monitor goroutine only + // completed is set from master Progress goroutine only completed bool operateState chan func(*bState) - done chan struct{} - shutdown chan struct{} - - // it's guaranteed that cacheState isn't nil, after done is closed + // done is closed by Bar's goroutine, after cacheState is written + done chan struct{} + // shutdown is closed from master Progress goroutine only + shutdown chan struct{} + cacheState *bState }