diff options
| author | Rob Pike <r@golang.org> | 2009-05-08 15:55:45 -0700 |
|---|---|---|
| committer | Rob Pike <r@golang.org> | 2009-05-08 15:55:45 -0700 |
| commit | 4f211612690965c3a9cd5362257fcac346f41c60 (patch) | |
| tree | 80f0f929f7b3221c245031b88d3b2ccafeaf5ff7 /src/lib | |
| parent | b3533dfd72ca505ac0f16e51f1a0e38f1ad90c34 (diff) | |
| download | go-4f211612690965c3a9cd5362257fcac346f41c60.tar.xz | |
Document runtime functions.
R=rsc
DELTA=25 (25 added, 0 deleted, 0 changed)
OCL=28574
CL=28580
Diffstat (limited to 'src/lib')
| -rw-r--r-- | src/lib/runtime/runtime.go | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/src/lib/runtime/runtime.go b/src/lib/runtime/runtime.go new file mode 100644 index 0000000000..e3cf54c7f1 --- /dev/null +++ b/src/lib/runtime/runtime.go @@ -0,0 +1,26 @@ +// Copyright 2009 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. + +/* + The runtime package contains operations that interact with Go's runtime system, + such as functions to control goroutines. + */ +package runtime + +// Gosched yields the processor, allowing other goroutines to run. It does not +// suspend the current goroutine, so execution resumes automatically. +func Gosched() + +// Goexit terminates the goroutine that calls it. No other goroutine is affected. +func Goexit() + +// Breakpoint() executes a breakpoint trap. +func Breakpoint() + +// Caller reports file and line number information about function invocations on +// the calling goroutine's stack. The argument is the number of stack frames to +// ascend, with 1 identifying the the caller of Caller. The return values report the +// program counter, file name, and line number within the file of the corresponding +// call. The boolean ok is false if it was not possible to recover the information. +func Caller(n int) (pc uint64, file string, line int, ok bool) |
