Merge pull request #25141 from jsafrane/devel/fix-store-race

Make threadSafeMap.ListIndexFuncValues thread safe.
pull/6/head
Robert Bailey 2016-05-06 13:50:36 -07:00
commit 64e1240180
1 changed files with 3 additions and 0 deletions

View File

@ -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 {