1
0
mirror of https://github.com/redis/go-redis.git synced 2025-08-08 23:42:06 +03:00

Merge pull request #736 from go-redis/fix/reorder-atomic-field

Re-order atomic field to please race detector
This commit is contained in:
Vladimir Mihailenco
2018-03-07 15:04:53 +02:00
committed by GitHub

View File

@@ -492,12 +492,13 @@ func (c *clusterState) slotNodes(slot int) []*clusterNode {
type clusterStateHolder struct {
load func() (*clusterState, error)
reloading uint32 // atomic
state atomic.Value
lastErrMu sync.RWMutex
lastErr error
reloading uint32 // atomic
}
func newClusterStateHolder(fn func() (*clusterState, error)) *clusterStateHolder {