소스 검색

Merge pull request #184 from iopred/patch-7

Add missing RLock in State.Channel
Bruce 9 년 전
부모
커밋
f64bae1371
1개의 변경된 파일3개의 추가작업 그리고 0개의 파일을 삭제
  1. 3 0
      state.go

+ 3 - 0
state.go

@@ -324,6 +324,9 @@ func (s *State) Channel(channelID string) (*Channel, error) {
 	if s == nil {
 		return nil, ErrNilState
 	}
+	
+	s.RLock()
+	defer s.RUnlock()
 
 	if c, ok := s.channelMap[channelID]; ok {
 		return c, nil