mirror of
https://github.com/k3s-io/kubernetes.git
synced 2025-07-24 20:24:09 +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.
|
// workerCount returns the total number of probe workers. For testing.
|
||||||
func (m *manager) workerCount() int {
|
func (m *manager) workerCount() int {
|
||||||
m.workerLock.Lock()
|
m.workerLock.RLock()
|
||||||
defer m.workerLock.Unlock()
|
defer m.workerLock.RUnlock()
|
||||||
return len(m.workers)
|
return len(m.workers)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user