]> Cypherpunks repositories - gostls13.git/commit
runtime: lock the main goroutine to the main OS thread during init
authorRuss Cox <rsc@golang.org>
Fri, 28 Oct 2011 01:04:12 +0000 (18:04 -0700)
committerRuss Cox <rsc@golang.org>
Fri, 28 Oct 2011 01:04:12 +0000 (18:04 -0700)
commit6808da0163a353f7c4d871a215417e0da4db71f8
tree9a1730b2a5120ac968c93b899a830217c88ccd76
parent32f3770ec51a8317214ac5b3725fb827c5b98e86
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
src/pkg/runtime/386/asm.s
src/pkg/runtime/amd64/asm.s
src/pkg/runtime/arm/asm.s
src/pkg/runtime/debug.go
src/pkg/runtime/proc.c
src/pkg/runtime/runtime.h