1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00

Merge pull request #21400 from LK4D4/fix_volumes_race

volume/local: fix race in List
This commit is contained in:
David Calavera 2016-03-22 14:29:12 -07:00
commit 2ec1764d45

View file

@ -121,9 +121,11 @@ type Root struct {
// List lists all the volumes
func (r *Root) List() ([]volume.Volume, error) {
var ls []volume.Volume
r.m.Lock()
for _, v := range r.volumes {
ls = append(ls, v)
}
r.m.Unlock()
return ls, nil
}