Fix deadlock

This commit is contained in:
Daniel 2020-04-17 21:50:24 +02:00
parent 30a6948009
commit 7a2b5a29aa

View file

@ -85,9 +85,9 @@ func (f *Feeder) SupplyEntropyAsIntIfNeeded(n int64, entropy int) {
} }
} }
// CloseFeeder stops the feed processing - the responsible goroutine exits. // CloseFeeder stops the feed processing - the responsible goroutine exits. The input channel is closed and the feeder may not be used anymore in any way.
func (f *Feeder) CloseFeeder() { func (f *Feeder) CloseFeeder() {
f.input <- nil close(f.input)
} }
func (f *Feeder) run(ctx context.Context) error { func (f *Feeder) run(ctx context.Context) error {