diff options
author | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-20 00:18:15 +0000 |
---|---|---|
committer | ian <ian@138bc75d-0d04-0410-961f-82ee72b054a4> | 2011-05-20 00:18:15 +0000 |
commit | 84911de8492fb75007eec6bfa4abb7905439f93c (patch) | |
tree | c891bdec1e6f073f73fedeef23718bc3ac30d499 /libgo/go/runtime | |
parent | ad33e6a8510b48571eaef50af339892925108830 (diff) | |
download | gcc-84911de8492fb75007eec6bfa4abb7905439f93c.tar.gz |
Update to current version of Go library.
git-svn-id: svn+ssh://gcc.gnu.org/svn/gcc/trunk@173931 138bc75d-0d04-0410-961f-82ee72b054a4
Diffstat (limited to 'libgo/go/runtime')
-rw-r--r-- | libgo/go/runtime/debug/stack.go | 4 | ||||
-rw-r--r-- | libgo/go/runtime/extern.go | 2 | ||||
-rw-r--r-- | libgo/go/runtime/proc_test.go | 43 | ||||
-rw-r--r-- | libgo/go/runtime/type.go | 5 |
4 files changed, 49 insertions, 5 deletions
diff --git a/libgo/go/runtime/debug/stack.go b/libgo/go/runtime/debug/stack.go index e7d56ac233d..e5fae632b13 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 c6e664abbbb..9da3423c618 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 00000000000..a15b2d80a4e --- /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 f5f3ef1baad..b59f2e4c383 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. |