diff options
| author | Russ Cox <rsc@golang.org> | 2011-10-27 18:04:12 -0700 |
|---|---|---|
| committer | Russ Cox <rsc@golang.org> | 2011-10-27 18:04:12 -0700 |
| commit | 6808da0163a353f7c4d871a215417e0da4db71f8 (patch) | |
| tree | 9a1730b2a5120ac968c93b899a830217c88ccd76 /src/pkg/runtime/debug.go | |
| parent | 32f3770ec51a8317214ac5b3725fb827c5b98e86 (diff) | |
| download | go-6808da0163a353f7c4d871a215417e0da4db71f8.tar.xz | |
runtime: lock the main goroutine to the main OS thread during init
We only guarantee that the main goroutine runs on the
main OS thread for initialization. Programs that wish to
preserve that property for main.main can call runtime.LockOSThread.
This is what programs used to do before we unleashed
goroutines during init, so it is both a simple fix and keeps
existing programs working.
R=iant, r, dave, dvyukov
CC=golang-dev
https://golang.org/cl/5309070
Diffstat (limited to 'src/pkg/runtime/debug.go')
| -rw-r--r-- | src/pkg/runtime/debug.go | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/src/pkg/runtime/debug.go b/src/pkg/runtime/debug.go index 6370a57d80..124370384c 100644 --- a/src/pkg/runtime/debug.go +++ b/src/pkg/runtime/debug.go @@ -10,7 +10,6 @@ func Breakpoint() // LockOSThread wires the calling goroutine to its current operating system thread. // Until the calling goroutine exits or calls UnlockOSThread, it will always // execute in that thread, and no other goroutine can. -// LockOSThread cannot be used during init functions. func LockOSThread() // UnlockOSThread unwires the calling goroutine from its fixed operating system thread. |
