summaryrefslogtreecommitdiff
path: root/libgo/go/sync
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/sync')
-rw-r--r--libgo/go/sync/atomic/atomic_test.go6
-rw-r--r--libgo/go/sync/atomic/value.go12
-rw-r--r--libgo/go/sync/cond.go2
-rw-r--r--libgo/go/sync/waitgroup.go12
4 files changed, 7 insertions, 25 deletions
diff --git a/libgo/go/sync/atomic/atomic_test.go b/libgo/go/sync/atomic/atomic_test.go
index 17baccb4683..39c40c6aaf5 100644
--- a/libgo/go/sync/atomic/atomic_test.go
+++ b/libgo/go/sync/atomic/atomic_test.go
@@ -30,7 +30,7 @@ const (
magic64 = 0xdeddeadbeefbeef
)
-// Do the 64-bit functions panic? If so, don't bother testing.
+// Do the 64-bit functions panic? If so, don't bother testing.
var test64err = func() (err interface{}) {
defer func() {
err = recover()
@@ -772,10 +772,8 @@ func init() {
if uintptr(v) != 0 {
// 64-bit system; clear uintptr tests
delete(hammer32, "SwapUintptr")
- delete(hammer32, "SwapPointer")
delete(hammer32, "AddUintptr")
delete(hammer32, "CompareAndSwapUintptr")
- delete(hammer32, "CompareAndSwapPointer")
}
}
@@ -923,10 +921,8 @@ func init() {
if uintptr(v) == 0 {
// 32-bit system; clear uintptr tests
delete(hammer64, "SwapUintptr")
- delete(hammer64, "SwapPointer")
delete(hammer64, "AddUintptr")
delete(hammer64, "CompareAndSwapUintptr")
- delete(hammer64, "CompareAndSwapPointer")
}
}
diff --git a/libgo/go/sync/atomic/value.go b/libgo/go/sync/atomic/value.go
index 1fc1f681f20..eab7e70c9b0 100644
--- a/libgo/go/sync/atomic/value.go
+++ b/libgo/go/sync/atomic/value.go
@@ -14,8 +14,6 @@ import (
//
// A Value must not be copied after first use.
type Value struct {
- noCopy noCopy
-
v interface{}
}
@@ -86,13 +84,3 @@ func (v *Value) Store(x interface{}) {
// Disable/enable preemption, implemented in runtime.
func runtime_procPin()
func runtime_procUnpin()
-
-// noCopy may be embedded into structs which must not be copied
-// after the first use.
-//
-// See https://github.com/golang/go/issues/8005#issuecomment-190753527
-// for details.
-type noCopy struct{}
-
-// Lock is a no-op used by -copylocks checker from `go vet`.
-func (*noCopy) Lock() {}
diff --git a/libgo/go/sync/cond.go b/libgo/go/sync/cond.go
index 14e2f6b24d4..3dcbf1c3512 100644
--- a/libgo/go/sync/cond.go
+++ b/libgo/go/sync/cond.go
@@ -89,7 +89,7 @@ func (c *copyChecker) check() {
// noCopy may be embedded into structs which must not be copied
// after the first use.
//
-// See https://github.com/golang/go/issues/8005#issuecomment-190753527
+// See https://golang.org/issues/8005#issuecomment-190753527
// for details.
type noCopy struct{}
diff --git a/libgo/go/sync/waitgroup.go b/libgo/go/sync/waitgroup.go
index f266f7c2b97..2fa7c3e07ed 100644
--- a/libgo/go/sync/waitgroup.go
+++ b/libgo/go/sync/waitgroup.go
@@ -63,13 +63,11 @@ func (wg *WaitGroup) Add(delta int) {
state := atomic.AddUint64(statep, uint64(delta)<<32)
v := int32(state >> 32)
w := uint32(state)
- if race.Enabled {
- if delta > 0 && v == int32(delta) {
- // The first increment must be synchronized with Wait.
- // Need to model this as a read, because there can be
- // several concurrent wg.counter transitions from 0.
- race.Read(unsafe.Pointer(&wg.sema))
- }
+ if race.Enabled && delta > 0 && v == int32(delta) {
+ // The first increment must be synchronized with Wait.
+ // Need to model this as a read, because there can be
+ // several concurrent wg.counter transitions from 0.
+ race.Read(unsafe.Pointer(&wg.sema))
}
if v < 0 {
panic("sync: negative WaitGroup counter")