From 00c22b0b77277f4f87f24afa82f615c68fe18c9d Mon Sep 17 00:00:00 2001 From: fiatjaf Date: Sun, 16 Feb 2025 18:45:09 -0300 Subject: [PATCH] maybe fix logic for closing waitgroup in subMany() --- pool.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pool.go b/pool.go index f1ab868..925197a 100644 --- a/pool.go +++ b/pool.go @@ -312,7 +312,7 @@ func (pool *SimplePool) subMany( close(events) cancel(fmt.Errorf("aborted: %w", context.Cause(ctx))) } - if !eosed.Load() { + if eosed.CompareAndSwap(false, true) { eoseWg.Done() } }()