swarm/fuse: lock around minfo (#393)

This commit is contained in:
Anton Evangelatov 2018-04-18 17:58:01 +03:00 committed by Balint Gabor
parent a715a46bf6
commit 5f33e9a8f2

View file

@ -100,6 +100,7 @@ func mountDir(t *testing.T, api *api.Api, files map[string]fileInfo, bzzHash str
found := false found := false
mi := swarmfs.Listmounts() mi := swarmfs.Listmounts()
for _, minfo := range mi { for _, minfo := range mi {
minfo.lock.RLock()
if minfo.MountPoint == mountDir { if minfo.MountPoint == mountDir {
if minfo.StartManifest != bzzHash || if minfo.StartManifest != bzzHash ||
minfo.LatestManifest != bzzHash || minfo.LatestManifest != bzzHash ||
@ -108,6 +109,7 @@ func mountDir(t *testing.T, api *api.Api, files map[string]fileInfo, bzzHash str
} }
found = true found = true
} }
minfo.lock.RUnlock()
} }
// Test listMounts // Test listMounts