]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: fix comment (lost in shuffle)
authorRuss Cox <rsc@golang.org>
Tue, 12 Jul 2011 16:26:05 +0000 (09:26 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 12 Jul 2011 16:26:05 +0000 (09:26 -0700)
TBR=dvyukov
CC=golang-dev
https://golang.org/cl/4710041

src/pkg/runtime/proc.c

index 41a8a1b4df53af61f905342b1dc0609b1a9846db..133203a3ac4f550ad61ada9a0a81b68df5eed135 100644 (file)
@@ -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) {