aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/proc.c
diff options
context:
space:
mode:
authorRuss Cox <rsc@golang.org>2014-09-01 21:55:57 -0400
committerRuss Cox <rsc@golang.org>2014-09-01 21:55:57 -0400
commit649c83530a9c3a71319ed3d2ff53d9ecf2f2fd04 (patch)
treea90eaba529e9162d0ba91a2baeed6f8013abc4ff /src/pkg/runtime/proc.c
parent5dd9d582f175701fbf461c2e5ca6bbb1021cbd25 (diff)
downloadgo-649c83530a9c3a71319ed3d2ff53d9ecf2f2fd04.tar.xz
runtime: fix race detector running Go code on g0 of non-main thread
It looks like this has just always been broken: the race detector handles running Go code on g0 of the main thread and on g0 of any extra threads created by non-Go code, but it does not handle running Go code on g0 of non-main threads created by Go. Handle that. Should fix the race build failures on the dashboard. We're running into this now because we are running more and more Go code on g0. TBR=dvyukov CC=golang-codereviews https://golang.org/cl/137910043
Diffstat (limited to 'src/pkg/runtime/proc.c')
-rw-r--r--src/pkg/runtime/proc.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c
index 9143fcf596..1a82c8e541 100644
--- a/src/pkg/runtime/proc.c
+++ b/src/pkg/runtime/proc.c
@@ -1077,6 +1077,8 @@ newm(void(*fn)(void), P *p)
mp = runtime·allocm(p);
mp->nextp = p;
mp->mstartfn = fn;
+ if(raceenabled)
+ mp->g0->racectx = runtime·racegostart(newm);
if(runtime·iscgo) {
CgoThreadStart ts;