diff options
Diffstat (limited to 'src/pkg/sync')
| -rw-r--r-- | src/pkg/sync/atomic/atomic_test.go | 4 | ||||
| -rw-r--r-- | src/pkg/sync/mutex.go | 2 | ||||
| -rw-r--r-- | src/pkg/sync/once_test.go | 2 |
3 files changed, 5 insertions, 3 deletions
diff --git a/src/pkg/sync/atomic/atomic_test.go b/src/pkg/sync/atomic/atomic_test.go index 02ee24b35..ad7557650 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) diff --git a/src/pkg/sync/mutex.go b/src/pkg/sync/mutex.go index 2d46c8994..4fc02743c 100644 --- a/src/pkg/sync/mutex.go +++ b/src/pkg/sync/mutex.go @@ -6,6 +6,8 @@ // exclusion locks. Other than the Once and WaitGroup types, most are intended // for use by low-level library routines. Higher-level synchronization is // better done via channels and communication. +// +// Values containing the types defined in this package should not be copied. package sync import ( diff --git a/src/pkg/sync/once_test.go b/src/pkg/sync/once_test.go index 157a3667a..37075af17 100644 --- a/src/pkg/sync/once_test.go +++ b/src/pkg/sync/once_test.go @@ -5,9 +5,9 @@ package sync_test import ( + "runtime" . "sync" "sync/atomic" - "runtime" "testing" ) |
