From 7a2b5a29aaaacf238e69f42c673522ad467fd989 Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 17 Apr 2020 21:50:24 +0200 Subject: [PATCH] Fix deadlock --- rng/entropy.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/rng/entropy.go b/rng/entropy.go index ba32489..4d5f572 100644 --- a/rng/entropy.go +++ b/rng/entropy.go @@ -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() { - f.input <- nil + close(f.input) } func (f *Feeder) run(ctx context.Context) error {