aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/sync
diff options
context:
space:
mode:
authorIan Lance Taylor <iant@golang.org>2018-01-09 01:23:08 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2018-01-09 01:23:08 +0000
commit1a2f01efa63036a5104f203a4789e682c0e0915d (patch)
tree373e15778dc8295354584e1f86915ae493b604ff /libgo/go/sync
parent8799df67f2dab88f9fda11739c501780a85575e2 (diff)
downloadgcc-1a2f01efa63036a5104f203a4789e682c0e0915d.zip
gcc-1a2f01efa63036a5104f203a4789e682c0e0915d.tar.gz
gcc-1a2f01efa63036a5104f203a4789e682c0e0915d.tar.bz2
libgo: update to Go1.10beta1
Update the Go library to the 1.10beta1 release. Requires a few changes to the compiler for modifications to the map runtime code, and to handle some nowritebarrier cases in the runtime. Reviewed-on: https://go-review.googlesource.com/86455 gotools/: * Makefile.am (go_cmd_vet_files): New variable. (go_cmd_buildid_files, go_cmd_test2json_files): New variables. (s-zdefaultcc): Change from constants to functions. (noinst_PROGRAMS): Add vet, buildid, and test2json. (cgo$(EXEEXT)): Link against $(LIBGOTOOL). (vet$(EXEEXT)): New target. (buildid$(EXEEXT)): New target. (test2json$(EXEEXT)): New target. (install-exec-local): Install all $(noinst_PROGRAMS). (uninstall-local): Uninstasll all $(noinst_PROGRAMS). (check-go-tool): Depend on $(noinst_PROGRAMS). Copy down objabi.go. (check-runtime): Depend on $(noinst_PROGRAMS). (check-cgo-test, check-carchive-test): Likewise. (check-vet): New target. (check): Depend on check-vet. Look at cmd_vet-testlog. (.PHONY): Add check-vet. * Makefile.in: Rebuild. From-SVN: r256365
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 17baccb..39c40c6 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 1fc1f68..eab7e70 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 14e2f6b..3dcbf1c 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 f266f7c..2fa7c3e 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")