This commit is contained in:
parent
e2639f51ee
commit
1cfd97a3ba
|
@ -57,7 +57,7 @@ func (q *Queue) spliceSources(input Source) (output Source, cancel chan bool) {
|
|||
go func() {
|
||||
defer close(output.Blocks)
|
||||
L:
|
||||
for range input.Blocks {
|
||||
for {
|
||||
select {
|
||||
case <-cancel:
|
||||
break L
|
||||
|
@ -217,6 +217,7 @@ func (q *Queue) GetChannels() int {
|
|||
}
|
||||
|
||||
func (q *Queue) sendInterrupt() {
|
||||
//TODO: maybe use len() on channel?
|
||||
if atomic.LoadInt64(&q.interruptDepth) == 0 { //not waiting on interrupt
|
||||
atomic.AddInt64(&q.interruptDepth, 1)
|
||||
q.interrupt <- true
|
||||
|
|
Loading…
Reference in a new issue