runtime: avoid inconsistent goroutine state in profiler

Because profiling signals can arrive at any time, we must
handle the case where a profiling signal arrives halfway
through a goroutine switch. Luckily, although there is much
to think through, very little needs to change.

Fixes #6000.
Fixes #6015.

R=golang-dev, dvyukov
CC=golang-dev
https://golang.org/cl/13421048
This commit is contained in:
Russ Cox 2013-09-13 14:19:23 -04:00
parent 7fb3d8e45e
commit 439f9397fc
8 changed files with 225 additions and 29 deletions

View file

@ -79,3 +79,5 @@ var StringHash = stringHash
var BytesHash = bytesHash
var Int32Hash = int32Hash
var Int64Hash = int64Hash
func GogoBytes() int32