mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-08-01 07:47:56 +00:00
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
This commit is contained in:
commit
c4e2ade371
@ -125,7 +125,7 @@ type podStorage struct {
|
|||||||
updates chan<- kubetypes.PodUpdate
|
updates chan<- kubetypes.PodUpdate
|
||||||
|
|
||||||
// contains the set of all sources that have sent at least one SET
|
// contains the set of all sources that have sent at least one SET
|
||||||
sourcesSeenLock sync.Mutex
|
sourcesSeenLock sync.RWMutex
|
||||||
sourcesSeen sets.String
|
sourcesSeen sets.String
|
||||||
|
|
||||||
// the EventRecorder to use
|
// the EventRecorder to use
|
||||||
@ -314,8 +314,8 @@ func (s *podStorage) markSourceSet(source string) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
func (s *podStorage) seenSources(sources ...string) bool {
|
func (s *podStorage) seenSources(sources ...string) bool {
|
||||||
s.sourcesSeenLock.Lock()
|
s.sourcesSeenLock.RLock()
|
||||||
defer s.sourcesSeenLock.Unlock()
|
defer s.sourcesSeenLock.RUnlock()
|
||||||
return s.sourcesSeen.HasAll(sources...)
|
return s.sourcesSeen.HasAll(sources...)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user