Skip to content

Commit

Permalink
linear: use RLock when reading
Browse files Browse the repository at this point in the history
Signed-off-by: Fu-Sheng <fscnick.dev@gmail.com>
  • Loading branch information
fscnick committed Sep 4, 2022
1 parent 54bb6cd commit 8b4033f
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions pkg/server/stream/v3/stream.go
Original file line number Diff line number Diff line change
Expand Up @@ -115,8 +115,8 @@ func (s *StreamState) SetKnownResourceNamesAsList(url string, names []string) {
}

func (s *StreamState) GetKnownResourceNames(url string) map[string]struct{} {
s.mu.Lock()
defer s.mu.Unlock()
s.mu.RLock()
defer s.mu.RUnlock()

return s.knownResourceNames[url]
}
Expand Down

0 comments on commit 8b4033f

Please sign in to comment.