aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/debug.go
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-10-27 18:04:12 -0700
committerRuss Cox <rsc@golang.org>2011-10-27 18:04:12 -0700
commit6808da0163a353f7c4d871a215417e0da4db71f8 (patch)
tree9a1730b2a5120ac968c93b899a830217c88ccd76 /src/pkg/runtime/debug.go
parent32f3770ec51a8317214ac5b3725fb827c5b98e86 (diff)
downloadgo-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.go1
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.