mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-23 11:50:44 +00:00
get workers length shoud use RLock
This commit is contained in:
parent
c393f11261
commit
1c13540671
@ -234,8 +234,8 @@ func (m *manager) removeWorker(podUID types.UID, containerName string, probeType
|
||||
|
||||
// workerCount returns the total number of probe workers. For testing.
|
||||
func (m *manager) workerCount() int {
|
||||
m.workerLock.Lock()
|
||||
defer m.workerLock.Unlock()
|
||||
m.workerLock.RLock()
|
||||
defer m.workerLock.RUnlock()
|
||||
return len(m.workers)
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user