mirror of https://github.com/k3s-io/k3s
Merge pull request #25141 from jsafrane/devel/fix-store-race
Make threadSafeMap.ListIndexFuncValues thread safe.pull/6/head
commit
64e1240180
|
@ -179,6 +179,9 @@ func (c *threadSafeMap) ByIndex(indexName, indexKey string) ([]interface{}, erro
|
|||
}
|
||||
|
||||
func (c *threadSafeMap) ListIndexFuncValues(indexName string) []string {
|
||||
c.lock.RLock()
|
||||
defer c.lock.RUnlock()
|
||||
|
||||
index := c.indices[indexName]
|
||||
names := make([]string, 0, len(index))
|
||||
for key := range index {
|
||||
|
|
Loading…
Reference in New Issue