aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2011-07-12 09:26:05 -0700
committerRuss Cox <rsc@golang.org>2011-07-12 09:26:05 -0700
commit88e0c0517aa0dfdb45441bb361009cd4866afb22 (patch)
tree086806358d02b6c54586e23dfc4941a30c847d48 /src/pkg/runtime
parentc9152a8568fd49b2e7a5dd689005098487a6178d (diff)
downloadgo-88e0c0517aa0dfdb45441bb361009cd4866afb22.tar.xz
runtime: fix comment (lost in shuffle)
TBR=dvyukov CC=golang-dev https://golang.org/cl/4710041
Diffstat (limited to 'src/pkg/runtime')
-rw-r--r--src/pkg/runtime/proc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 41a8a1b4df..133203a3ac 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -210,8 +210,11 @@ runtime·idlegoroutine(void)
static void
mcommoninit(M *m)
{
+ // Add to runtime·allm so garbage collector doesn't free m
+ // when it is just in a register or thread-local storage.
m->alllink = runtime·allm;
runtime·allm = m;
+
m->id = runtime·sched.mcount++;
m->fastrand = 0x49f6428aUL + m->id;
m->stackalloc = runtime·malloc(sizeof(*m->stackalloc));
@@ -502,8 +505,6 @@ matchmg(void)
// Find the m that will run g.
if((m = mget(g)) == nil){
m = runtime·malloc(sizeof(M));
- // Add to runtime·allm so garbage collector doesn't free m
- // when it is just in a register or thread-local storage.
mcommoninit(m);
if(runtime·iscgo) {