swarm: send notifications synchronously (#1562)

This commit is contained in:
Marten Seemann 2022-06-01 18:41:54 +02:00 committed by GitHub
parent fd697bb605
commit e732bda3fa
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 9 deletions

View File

@ -541,18 +541,10 @@ func (s *Swarm) Backoff() *DialBackoff {
// notifyAll sends a signal to all Notifiees
func (s *Swarm) notifyAll(notify func(network.Notifiee)) {
var wg sync.WaitGroup
s.notifs.RLock()
wg.Add(len(s.notifs.m))
for f := range s.notifs.m {
go func(f network.Notifiee) {
defer wg.Done()
notify(f)
}(f)
notify(f)
}
wg.Wait()
s.notifs.RUnlock()
}