clearAddresses write locks the struct and then calls notify. notify in turn tries to obtain a read lock on the same mutex. The result was a deadlock. This change unlocks the struct before calling notify.
This commit is contained in:
@@ -53,11 +53,11 @@ func (m *Mapping) clearAddresses() {
|
||||
removed = append(removed, addr)
|
||||
delete(m.extAddresses, id)
|
||||
}
|
||||
m.expires = time.Time{}
|
||||
m.mut.Unlock()
|
||||
if len(removed) > 0 {
|
||||
m.notify(nil, removed)
|
||||
}
|
||||
m.expires = time.Time{}
|
||||
m.mut.Unlock()
|
||||
}
|
||||
|
||||
func (m *Mapping) notify(added, removed []Address) {
|
||||
|
||||
Reference in New Issue
Block a user