Merge pull request #4734 from luxas/32bit_alignments

etcdserver: align 64-bit atomics on 8-byte boundary
This commit is contained in:
Anthony Romano 2016-04-10 19:18:15 -07:00
commit 130567832f

View File

@ -156,8 +156,12 @@ type Server interface {
// EtcdServer is the production implementation of the Server interface
type EtcdServer struct {
// r must be the first element to keep 64-bit alignment for atomic
// r and inflightSnapshots must be the first elements to keep 64-bit alignment for atomic
// access to fields
// count the number of inflight snapshots.
// MUST use atomic operation to access this field.
inflightSnapshots int64
r raftNode
cfg *ServerConfig
@ -202,10 +206,6 @@ type EtcdServer struct {
forceVersionC chan struct{}
msgSnapC chan raftpb.Message
// count the number of inflight snapshots.
// MUST use atomic operation to access this field.
inflightSnapshots int64
}
// NewServer creates a new EtcdServer from the supplied configuration. The