Skip to content

Commit

Permalink
Re-order atomic field to please race detector
Browse files Browse the repository at this point in the history
  • Loading branch information
vmihailenco committed Mar 7, 2018
1 parent 21fc761 commit 4fe9f93
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cluster.go
Original file line number Diff line number Diff line change
Expand Up @@ -491,13 +491,14 @@ func (c *clusterState) slotNodes(slot int) []*clusterNode {
//------------------------------------------------------------------------------

type clusterStateHolder struct {
load func() (*clusterState, error)
reloading uint32 // atomic
load func() (*clusterState, error)

state atomic.Value

lastErrMu sync.RWMutex
lastErr error

reloading uint32 // atomic
}

func newClusterStateHolder(fn func() (*clusterState, error)) *clusterStateHolder {
Expand Down

0 comments on commit 4fe9f93

Please sign in to comment.