From ba7dc5de064f7db4a41da2fd75757b46eca16ef5 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Mon, 16 Jan 2012 11:43:36 +0400 Subject: [PATCH] sync/atomic: fix data race in tests Fixes #2710. R=golang-dev, dsymonds CC=golang-dev https://golang.org/cl/5541066 --- src/pkg/sync/atomic/atomic_test.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/pkg/sync/atomic/atomic_test.go b/src/pkg/sync/atomic/atomic_test.go index 02ee24b355..ad7557650f 100644 --- a/src/pkg/sync/atomic/atomic_test.go +++ b/src/pkg/sync/atomic/atomic_test.go @@ -1037,7 +1037,7 @@ func TestStoreLoadSeqCst32(t *testing.T) { if my != i && 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 }(p) @@ -1078,7 +1078,7 @@ func TestStoreLoadSeqCst64(t *testing.T) { if my != i && 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 }(p)