get workers length shoud use RLock

This commit is contained in:
Ke Zhang 2016-08-05 16:05:18 +08:00
parent c393f11261
commit 1c13540671

View File

@ -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)
}