Commit ba7dc5de authored by Dmitriy Vyukov's avatar Dmitriy Vyukov

sync/atomic: fix data race in tests

Fixes #2710.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5541066
parent 3d2e75cf
...@@ -1037,7 +1037,7 @@ func TestStoreLoadSeqCst32(t *testing.T) { ...@@ -1037,7 +1037,7 @@ func TestStoreLoadSeqCst32(t *testing.T) {
if my != i && his != i { if my != i && his != i {
t.Fatalf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i) t.Fatalf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i)
} }
ack[me][(i-1)%3] = -1 StoreInt32(&ack[me][(i-1)%3], -1)
} }
c <- true c <- true
}(p) }(p)
...@@ -1078,7 +1078,7 @@ func TestStoreLoadSeqCst64(t *testing.T) { ...@@ -1078,7 +1078,7 @@ func TestStoreLoadSeqCst64(t *testing.T) {
if my != i && his != i { if my != i && his != i {
t.Fatalf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i) t.Fatalf("store/load are not sequentially consistent: %d/%d (%d)", my, his, i)
} }
ack[me][(i-1)%3] = -1 StoreInt64(&ack[me][(i-1)%3], -1)
} }
c <- true c <- true
}(p) }(p)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment