1
0
mirror of https://github.com/golang/go synced 2024-11-24 23:07:56 -07:00

sync/atomic: fix data race in tests

Fixes #2710.

R=golang-dev, dsymonds
CC=golang-dev
https://golang.org/cl/5541066
This commit is contained in:
Dmitriy Vyukov 2012-01-16 11:43:36 +04:00
parent 3d2e75cf92
commit ba7dc5de06

View File

@ -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) {
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)