mirror of
https://github.com/ScuroNeko/mtg.git
synced 2026-09-01 16:01:55 +03:00
Rename rwMutex to updateMutex
This commit is contained in:
@@ -45,7 +45,7 @@ type Firehol struct {
|
|||||||
ctxCancel context.CancelFunc
|
ctxCancel context.CancelFunc
|
||||||
logger mtglib.Logger
|
logger mtglib.Logger
|
||||||
|
|
||||||
rwMutex sync.RWMutex
|
updateMutex sync.RWMutex
|
||||||
|
|
||||||
remoteURLs []string
|
remoteURLs []string
|
||||||
localFiles []string
|
localFiles []string
|
||||||
@@ -68,8 +68,8 @@ func (f *Firehol) Contains(ip net.IP) bool {
|
|||||||
return true
|
return true
|
||||||
}
|
}
|
||||||
|
|
||||||
f.rwMutex.RLock()
|
f.updateMutex.RLock()
|
||||||
defer f.rwMutex.RUnlock()
|
defer f.updateMutex.RUnlock()
|
||||||
|
|
||||||
if ip4 := ip.To4(); ip4 != nil {
|
if ip4 := ip.To4(); ip4 != nil {
|
||||||
return f.containsIPv4(ip4)
|
return f.containsIPv4(ip4)
|
||||||
@@ -194,8 +194,8 @@ func (f *Firehol) update() error { // nolint: funlen, cyclop
|
|||||||
default:
|
default:
|
||||||
}
|
}
|
||||||
|
|
||||||
f.rwMutex.Lock()
|
f.updateMutex.Lock()
|
||||||
defer f.rwMutex.Unlock()
|
defer f.updateMutex.Unlock()
|
||||||
|
|
||||||
f.treeV4 = v4tree
|
f.treeV4 = v4tree
|
||||||
f.treeV6 = v6tree
|
f.treeV6 = v6tree
|
||||||
|
|||||||
Reference in New Issue
Block a user