1 // Copyright 2010 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
10 func GOMAXPROCS(n int) (ret int) {
11 ret = runtime_gomaxprocsfunc(n);
14 func NumCPU() (ret int) {
18 func NumCgoCall() (ret int64) {
22 for(mp=runtime_atomicloadp(&runtime_allm); mp; mp=mp->alllink)
26 func newParFor(nthrmax uint32) (desc *ParFor) {
27 desc = runtime_parforalloc(nthrmax);
30 func parForSetup(desc *ParFor, nthr uint32, n uint32, wait bool, body *byte) {
31 runtime_parforsetup(desc, nthr, n, wait, (const FuncVal*) body);
34 func parForDo(desc *ParFor) {
35 runtime_parfordo(desc);
38 func parForIters(desc *ParFor, tid uintptr) (start uintptr, end uintptr) {
39 runtime_parforiters(desc, tid, &start, &end);
42 func typestring(e Eface) (s String) {
43 s = *e.__type_descriptor->__reflection;
46 func golockedOSThread() (ret bool) {
47 ret = runtime_lockedOSThread();
50 func NumGoroutine() (ret int) {
51 ret = runtime_gcount();
54 func getgoroot() (out String) {
55 out = runtime_getenv("GOROOT");
58 func runtime_pprof.runtime_cyclesPerSecond() (res int64) {
59 res = runtime_tickspersecond();
62 func sync.runtime_procPin() (p int) {
66 // Disable preemption.
71 func sync.runtime_procUnpin() {
75 func sync_atomic.runtime_procPin() (p int) {
79 // Disable preemption.
84 func sync_atomic.runtime_procUnpin() {
90 func envs() (s Slice) {
94 func setenvs(e Slice) {