*: fix various data races detected by race detector

This commit is contained in:
Xiang Li
2015-10-26 20:26:43 -07:00
parent 336d177c82
commit a8e6e71bf9
4 changed files with 32 additions and 2 deletions

View File

@ -220,6 +220,9 @@ func (c *cluster) SetID(id types.ID) { c.id = id }
func (c *cluster) SetStore(st store.Store) { c.store = st }
func (c *cluster) Recover() {
c.Lock()
defer c.Unlock()
c.members, c.removed = membersFromStore(c.store)
c.version = clusterVersionFromStore(c.store)
MustDetectDowngrade(c.version)