Bring back the Lock as it's technically correct.
This commit is contained in:
parent
79247272ff
commit
c291988335
1 changed files with 2 additions and 4 deletions
|
@ -218,14 +218,12 @@ func (s *Session) handle(event interface{}) {
|
|||
|
||||
// initialize adds all internal handlers and state tracking handlers.
|
||||
func (s *Session) initialize() {
|
||||
s.handlersMu.RLock()
|
||||
s.handlersMu.Lock()
|
||||
if s.handlers != nil {
|
||||
s.handlersMu.RUnlock()
|
||||
s.handlersMu.Unlock()
|
||||
return
|
||||
}
|
||||
s.handlersMu.RUnlock()
|
||||
|
||||
s.handlersMu.Lock()
|
||||
s.handlers = map[interface{}][]reflect.Value{}
|
||||
s.handlersMu.Unlock()
|
||||
|
||||
|
|
Loading…
Reference in a new issue