Re-order atomic field to please race detector

This commit is contained in:
Vladimir Mihailenco 2018-03-07 14:38:18 +02:00
parent 21fc7616bb
commit 4fe9f93940
1 changed files with 3 additions and 2 deletions

View File

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