1
0
mirror of https://github.com/redis/go-redis.git synced 2025-07-31 05:04:23 +03:00

Add more race tests

This commit is contained in:
Vladimir Mihailenco
2018-05-17 14:36:51 +03:00
parent bc49453a24
commit 34facee367
4 changed files with 48 additions and 39 deletions

View File

@ -220,7 +220,7 @@ type clusterNodes struct {
nodeCreateGroup singleflight.Group
generation uint32
_generation uint32 // atomic
}
func newClusterNodes(opt *ClusterOptions) *clusterNodes {
@ -277,8 +277,7 @@ func (c *clusterNodes) Addrs() ([]string, error) {
}
func (c *clusterNodes) NextGeneration() uint32 {
c.generation++
return c.generation
return atomic.AddUint32(&c._generation, 1)
}
// GC removes unused nodes.