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 (
32
32
// A Client is an OVSDB client. Clients can be customized by using OptionFuncs
33
33
// in the Dial and New functions.
34
34
type 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
38
38
39
39
// Incremented atomically when sending RPCs.
40
40
rpcID int64
41
41
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
+
42
51
// Callbacks for RPC responses.
43
52
cbMu sync.RWMutex
44
53
callbacks map [string ]callback
45
54
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
50
57
51
58
// Track and clean up background goroutines.
52
59
cancel func ()
You can’t perform that action at this time.
0 commit comments