Lock zone pattern deletion too

Go 1.5 -race flags this as data race, it's not performance critical,
add locking on the mutex.
This commit is contained in:
Miek Gieben 2015-08-22 18:31:23 +01:00
parent 996ff55983
commit a6742d536c
1 changed files with 2 additions and 2 deletions

View File

@ -159,9 +159,9 @@ func (mux *ServeMux) HandleRemove(pattern string) {
if pattern == "" {
panic("dns: invalid pattern " + pattern)
}
// don't need a mutex here, because deleting is OK, even if the
// entry is note there.
mux.m.Lock()
delete(mux.z, Fqdn(pattern))
mux.m.Unlock()
}
// ServeDNS dispatches the request to the handler whose