diff --git a/bar.go b/bar.go index 3b83508..e3366ba 100644 --- a/bar.go +++ b/bar.go @@ -26,7 +26,6 @@ hasEwmaDecorators bool operateState chan func(*bState) frameCh chan *frame - syncTableCh chan [][]chan int // cancel is called either by user or on complete event cancel func() @@ -91,7 +90,6 @@ noPop: bs.noPop, operateState: make(chan func(*bState)), frameCh: make(chan *frame, 1), - syncTableCh: make(chan [][]chan int, 1), done: make(chan struct{}), cancel: cancel, dlogger: log.New(bs.debugOut, logPrefix, log.Lshortfile), @@ -384,9 +382,10 @@ } func (b *Bar) wSyncTable() [][]chan int { - select { - case b.operateState <- func(s *bState) { b.syncTableCh <- s.wSyncTable() }: - return <-b.syncTableCh + result := make(chan [][]chan int) + select { + case b.operateState <- func(s *bState) { result <- s.wSyncTable() }: + return <-result case <-b.done: return b.cacheState.wSyncTable() }