aboutsummaryrefslogtreecommitdiff
path: root/libgo/go/runtime
diff options
context:
space:
mode:
Diffstat (limited to 'libgo/go/runtime')
-rw-r--r--libgo/go/runtime/chan_test.go9
-rw-r--r--libgo/go/runtime/debug.go3
-rw-r--r--libgo/go/runtime/extern.go3
3 files changed, 12 insertions, 3 deletions
diff --git a/libgo/go/runtime/chan_test.go b/libgo/go/runtime/chan_test.go
index 7cea906..eb2c7c6 100644
--- a/libgo/go/runtime/chan_test.go
+++ b/libgo/go/runtime/chan_test.go
@@ -371,3 +371,12 @@ func BenchmarkChanCreation(b *testing.B) {
<-c
}
}
+
+func BenchmarkChanSem(b *testing.B) {
+ type Empty struct{}
+ c := make(chan Empty, 1)
+ for i := 0; i < b.N; i++ {
+ c <- Empty{}
+ <-c
+ }
+}
diff --git a/libgo/go/runtime/debug.go b/libgo/go/runtime/debug.go
index c2b9056..4f09146 100644
--- a/libgo/go/runtime/debug.go
+++ b/libgo/go/runtime/debug.go
@@ -23,6 +23,9 @@ func UnlockOSThread()
// This call will go away when the scheduler improves.
func GOMAXPROCS(n int) int
+// NumCPU returns the number of logical CPUs on the local machine.
+func NumCPU() int
+
// Cgocalls returns the number of cgo calls made by the current process.
func Cgocalls() int64
diff --git a/libgo/go/runtime/extern.go b/libgo/go/runtime/extern.go
index 88598cb..eafa2f1 100644
--- a/libgo/go/runtime/extern.go
+++ b/libgo/go/runtime/extern.go
@@ -68,9 +68,6 @@ func funcline_go(*Func, uintptr) (string, int)
// mid returns the current os thread (m) id.
func mid() uint32
-// NumCPU returns the number of logical CPUs on the local machine.
-func NumCPU() int
-
// Semacquire waits until *s > 0 and then atomically decrements it.
// It is intended as a simple sleep primitive for use by the synchronization
// library and should not be used directly.