We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 2776cc1 + 04a7b50 commit 24c964dCopy full SHA for 24c964d
staging/src/k8s.io/apiserver/pkg/storage/cacher/cacher.go
@@ -1245,7 +1245,7 @@ type ready struct {
1245
}
1246
1247
func newReady() *ready {
1248
- return &ready{c: sync.NewCond(&sync.Mutex{})}
+ return &ready{c: sync.NewCond(&sync.RWMutex{})}
1249
1250
1251
func (r *ready) wait() {
@@ -1259,8 +1259,9 @@ func (r *ready) wait() {
1259
// TODO: Make check() function more sophisticated, in particular
1260
// allow it to behave as "waitWithTimeout".
1261
func (r *ready) check() bool {
1262
- r.c.L.Lock()
1263
- defer r.c.L.Unlock()
+ rwMutex := r.c.L.(*sync.RWMutex)
+ rwMutex.RLock()
1264
+ defer rwMutex.RUnlock()
1265
return r.ok
1266
1267
0 commit comments