]> Cypherpunks repositories - gostls13.git/commit
runtime: factor stoptheworld/starttheworld pattern
authorAustin Clements <austin@google.com>
Fri, 15 May 2015 20:00:50 +0000 (16:00 -0400)
committerAustin Clements <austin@google.com>
Mon, 18 May 2015 14:55:25 +0000 (14:55 +0000)
commita1da255aa0b962231d80e594abe300200e6b4c73
tree5f96d6b0c32205c6836af6c748787464dd49d871
parent5f7060afd2dea927ac64804c7e4639f6635c3bb7
runtime: factor stoptheworld/starttheworld pattern

There are several steps to stopping and starting the world and
currently they're open-coded in several places. The garbage collector
is the only thing that needs to stop and start the world in a
non-trivial pattern. Replace all other uses with calls to higher-level
functions that implement the entire pattern necessary to stop and
start the world.

This is a pure refectoring and should not change any code semantics.
In the following commits, we'll make changes that are easier to do
with this abstraction in place.

This commit renames the old starttheworld to startTheWorldWithSema.
This is a slight misnomer right now because the callers release
worldsema just before calling this. However, a later commit will swap
these and I don't want to think of another name in the mean time.

Change-Id: I5dc97f87b44fb98963c49c777d7053653974c911
Reviewed-on: https://go-review.googlesource.com/10154
Reviewed-by: Russ Cox <rsc@golang.org>
src/runtime/debug.go
src/runtime/heapdump.go
src/runtime/mgc.go
src/runtime/mprof.go
src/runtime/mstats.go
src/runtime/proc.go
src/runtime/proc1.go
src/runtime/trace.go