]> Cypherpunks repositories - gostls13.git/commitdiff
add newprocreadylocked for debugger
authorRuss Cox <rsc@golang.org>
Tue, 1 Sep 2009 01:10:11 +0000 (18:10 -0700)
committerRuss Cox <rsc@golang.org>
Tue, 1 Sep 2009 01:10:11 +0000 (18:10 -0700)
R=austin
DELTA=10  (9 added, 0 deleted, 1 changed)
OCL=34163
CL=34166

src/pkg/runtime/proc.c

index bd8e954929153cf385d3243d9ac04b3f1f4feab9..06859b09ca02bf9b3ec886d324072cb1b9d66fe4 100644 (file)
@@ -265,6 +265,15 @@ readylocked(G *g)
                matchmg();
 }
 
+// Same as readylocked but a different symbol so that
+// debuggers can set a breakpoint here and catch all
+// new goroutines.
+static void
+newprocreadylocked(G *g)
+{
+       readylocked(g);
+}
+
 // Pass g to m for running.
 static void
 mnextg(M *m, G *g)
@@ -739,7 +748,7 @@ sys·newproc(int32 siz, byte* fn, byte* arg0)
        goidgen++;
        newg->goid = goidgen;
 
-       readylocked(newg);
+       newprocreadylocked(newg);
        unlock(&sched);
 
 //printf(" goid=%d\n", newg->goid);