Browse code

fix unsafe acces on arm

Signed-off-by: Victor Vieux <vieux@docker.com>

Victor Vieux authored on 2016/11/11 15:40:16
Showing 1 changed files
... ...
@@ -24,6 +24,15 @@ const (
24 24
 // NetworkDB instance drives the networkdb cluster and acts the broker
25 25
 // for cluster-scoped and network-scoped gossip and watches.
26 26
 type NetworkDB struct {
27
+	// The clocks MUST be the first things
28
+	// in this struct due to Golang issue #599.
29
+
30
+	// Global lamport clock for node network attach events.
31
+	networkClock serf.LamportClock
32
+
33
+	// Global lamport clock for table events.
34
+	tableClock serf.LamportClock
35
+
27 36
 	sync.RWMutex
28 37
 
29 38
 	// NetworkDB configuration.
... ...
@@ -59,12 +68,6 @@ type NetworkDB struct {
59 59
 	// waiting for an ack.
60 60
 	bulkSyncAckTbl map[string]chan struct{}
61 61
 
62
-	// Global lamport clock for node network attach events.
63
-	networkClock serf.LamportClock
64
-
65
-	// Global lamport clock for table events.
66
-	tableClock serf.LamportClock
67
-
68 62
 	// Broadcast queue for network event gossip.
69 63
 	networkBroadcasts *memberlist.TransmitLimitedQueue
70 64