summaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2009-08-31 18:10:11 -0700
committerRuss Cox <rsc@golang.org>2009-08-31 18:10:11 -0700
commit2de028f52fcd2cbbd5f91e35e4a304fa744900a9 (patch)
tree13a5332f785f735fc3e17b02d6ff4998f0cb6288 /src/pkg/runtime/proc.c
parent8eefd93b6e699e4c6a95752ebbcba485bd4b083c (diff)
downloadgolang-2de028f52fcd2cbbd5f91e35e4a304fa744900a9.tar.gz
add newprocreadylocked for debugger
R=austin DELTA=10 (9 added, 0 deleted, 1 changed) OCL=34163 CL=34166
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index bd8e95492..06859b09c 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -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);