File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
pkg/controller/resourcequota Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -69,7 +69,7 @@ type event struct {
69
69
type QuotaMonitor struct {
70
70
// each monitor list/watches a resource and determines if we should replenish quota
71
71
monitors monitors
72
- monitorLock sync.Mutex
72
+ monitorLock sync.RWMutex
73
73
// informersStarted is closed after after all of the controllers have been initialized and are running.
74
74
// After that it is safe to start them here, before that it is not.
75
75
informersStarted <- chan struct {}
@@ -280,8 +280,8 @@ func (qm *QuotaMonitor) StartMonitors() {
280
280
// true at one time, and then later return false if all monitors were
281
281
// reconstructed.
282
282
func (qm * QuotaMonitor ) IsSynced () bool {
283
- qm .monitorLock .Lock ()
284
- defer qm .monitorLock .Unlock ()
283
+ qm .monitorLock .RLock ()
284
+ defer qm .monitorLock .RUnlock ()
285
285
286
286
if len (qm .monitors ) == 0 {
287
287
klog .V (4 ).Info ("quota monitor not synced: no monitors" )
You can’t perform that action at this time.
0 commit comments