mirror of
https://github.com/golang/go
synced 2024-11-25 11:07:59 -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:
parent
3d2e75cf92
commit
ba7dc5de06
@ -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)
|
||||||
|
Loading…
Reference in New Issue
Block a user