1
0
Fork 0

Adding subscription should be safe

and not happen while cleaning up
This commit is contained in:
Gregory Eremin 2014-09-11 23:13:44 +04:00
parent 1735f11058
commit 2a0d88c3bb
1 changed files with 2 additions and 0 deletions

View File

@ -54,7 +54,9 @@ func (h *Hub) Sub(s *Subscription) {
}
}
h.lock.Lock()
h.subscribers = append(h.subscribers, s)
h.lock.Unlock()
}
func (h *Hub) Info() map[string]map[string]uint {