Commit c4e2ade3 authored by Kubernetes Submit Queue's avatar Kubernetes Submit Queue Committed by GitHub

Merge pull request #31761 from ZTE-PaaS/zhangke-patch-032

Automatic merge from submit-queue change sourcesSeenLock to sync.RWMutex seenSources can be accessed concurrently
parents 5e22e51f 29edf627
......@@ -125,7 +125,7 @@ type podStorage struct {
updates chan<- kubetypes.PodUpdate
// contains the set of all sources that have sent at least one SET
sourcesSeenLock sync.Mutex
sourcesSeenLock sync.RWMutex
sourcesSeen sets.String
// the EventRecorder to use
......@@ -314,8 +314,8 @@ func (s *podStorage) markSourceSet(source string) {
}
func (s *podStorage) seenSources(sources ...string) bool {
s.sourcesSeenLock.Lock()
defer s.sourcesSeenLock.Unlock()
s.sourcesSeenLock.RLock()
defer s.sourcesSeenLock.RUnlock()
return s.sourcesSeen.HasAll(sources...)
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment