remove mutex here

This commit is contained in:
Miek Gieben 2013-10-15 20:44:55 +01:00
parent 2bc1cd1a2e
commit 104d9bf0ba

View File

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