aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime
diff options
context:
space:
mode:
authorIan Lance Taylor <ian@gcc.gnu.org>2011-05-20 00:18:15 +0000
committerIan Lance Taylor <ian@gcc.gnu.org>2011-05-20 00:18:15 +0000
commit9ff56c9570642711d5b7ab29920ecf5dbff14a27 (patch)
treec891bdec1e6f073f73fedeef23718bc3ac30d499 /libgo/go/runtime
parent37cb25ed7acdb844b218231130e54b8b7a0ff6e6 (diff)
downloadgcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.zip
gcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.tar.gz
gcc-9ff56c9570642711d5b7ab29920ecf5dbff14a27.tar.bz2
Update to current version of Go library.
From-SVN: r173931
Diffstat (limited to 'libgo/go/runtime')
-rw-r--r--libgo/go/runtime/debug/stack.go4
-rw-r--r--libgo/go/runtime/extern.go2
-rw-r--r--libgo/go/runtime/proc_test.go43
-rw-r--r--libgo/go/runtime/type.go5
4 files changed, 49 insertions, 5 deletions
diff --git a/libgo/go/runtime/debug/stack.go b/libgo/go/runtime/debug/stack.go
index e7d56ac..e5fae63 100644
--- a/libgo/go/runtime/debug/stack.go
+++ b/libgo/go/runtime/debug/stack.go
@@ -2,8 +2,8 @@
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
-// The debug package contains facilities for programs to debug themselves
-// while they are running.
+// Package debug contains facilities for programs to debug themselves while
+// they are running.
package debug
import (
diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go
index c6e664a..9da3423 100644
--- a/libgo/go/runtime/extern.go
+++ b/libgo/go/runtime/extern.go
@@ -3,7 +3,7 @@
// license that can be found in the LICENSE file.
/*
- The runtime package contains operations that interact with Go's runtime system,
+ Package runtime contains operations that interact with Go's runtime system,
such as functions to control goroutines. It also includes the low-level type information
used by the reflect package; see reflect's documentation for the programmable
interface to the run-time type system.
diff --git a/libgo/go/runtime/proc_test.go b/libgo/go/runtime/proc_test.go
new file mode 100644
index 0000000..a15b2d8
--- /dev/null
+++ b/libgo/go/runtime/proc_test.go
@@ -0,0 +1,43 @@
+// Copyright 2011 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package runtime_test
+
+import (
+ "runtime"
+ "testing"
+)
+
+var stop = make(chan bool, 1)
+
+func perpetuumMobile() {
+ select {
+ case <-stop:
+ default:
+ go perpetuumMobile()
+ }
+}
+
+func TestStopTheWorldDeadlock(t *testing.T) {
+ if testing.Short() {
+ t.Logf("skipping during short test")
+ return
+ }
+ runtime.GOMAXPROCS(3)
+ compl := make(chan int, 1)
+ go func() {
+ for i := 0; i != 1000; i += 1 {
+ runtime.GC()
+ }
+ compl <- 0
+ }()
+ go func() {
+ for i := 0; i != 1000; i += 1 {
+ runtime.GOMAXPROCS(3)
+ }
+ }()
+ go perpetuumMobile()
+ <-compl
+ stop <- true
+}
diff --git a/libgo/go/runtime/type.go b/libgo/go/runtime/type.go
index f5f3ef1..b59f2e4 100644
--- a/libgo/go/runtime/type.go
+++ b/libgo/go/runtime/type.go
@@ -117,8 +117,9 @@ type UnsafePointerType commonType
// ArrayType represents a fixed array type.
type ArrayType struct {
commonType
- elem *Type // array element type
- len uintptr
+ elem *Type // array element type
+ slice *Type // slice type
+ len uintptr
}
// SliceType represents a slice type.