File tree Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Expand file tree Collapse file tree 1 file changed +14
-7
lines changed Original file line number Diff line number Diff line change @@ -32,21 +32,28 @@ import (
3232// A Client is an OVSDB client. Clients can be customized by using OptionFuncs
3333// in the Dial and New functions.
3434type Client struct {
35- // The RPC connection, and its logger.
36- c * jsonrpc. Conn
37- ll * log. Logger
35+ // NB: must 64-bit align these atomic integers, so they should appear first
36+ // in the Client structure.
37+ // See: https://golang.org/pkg/sync/atomic/#pkg-note-BUG
3838
3939 // Incremented atomically when sending RPCs.
4040 rpcID int64
4141
42+ // Statistics about the echo loop.
43+ echoOK , echoFail int64
44+
45+ // All other types should occur after atomic integers.
46+
47+ // The RPC connection, and its logger.
48+ c * jsonrpc.Conn
49+ ll * log.Logger
50+
4251 // Callbacks for RPC responses.
4352 cbMu sync.RWMutex
4453 callbacks map [string ]callback
4554
46- // Interval at which echo RPCs should occur in the background, and statistics
47- // about the echo loop.
48- echoInterval time.Duration
49- echoOK , echoFail int64
55+ // Interval at which echo RPCs should occur in the background.
56+ echoInterval time.Duration
5057
5158 // Track and clean up background goroutines.
5259 cancel func ()
You can’t perform that action at this time.
0 commit comments