Skip to content

Commit

Permalink
remove unnecessary lock
Browse files Browse the repository at this point in the history
  • Loading branch information
myleshorton committed Dec 6, 2024
1 parent 24178df commit da8e3e9
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions fronted.go
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,6 @@ type fronted struct {
connectingFronts connectingFronts
providersMu sync.RWMutex
frontsMu sync.RWMutex
frontedMu sync.RWMutex
stopCh chan interface{}
crawlOnce sync.Once
stopped atomic.Bool
Expand Down Expand Up @@ -114,11 +113,8 @@ func (f *fronted) UpdateConfig(pool *x509.CertPool, providers map[string]*Provid
return
}
providersCopy := copyProviders(providers)
f.frontedMu.Lock()
defer f.frontedMu.Unlock()
f.addProviders(providersCopy)
f.addFronts(loadFronts(providersCopy))

f.certPool.Store(pool)

// The goroutine for finding working fronts runs forever, so only start it once.
Expand Down

0 comments on commit da8e3e9

Please sign in to comment.