aboutsummaryrefslogtreecommitdiff
path: root/src/pkg/runtime/malloc.h
diff options
context:
space:
mode:
authorDmitriy Vyukov <dvyukov@google.com>2011-10-06 18:10:14 +0300
committerDmitriy Vyukov <dvyukov@google.com>2011-10-06 18:10:14 +0300
commit56959158331072ed17801aa539a0d6f28064b511 (patch)
tree1420df3557880dd9b7a0bbd343bf3aaedb231b78 /src/pkg/runtime/malloc.h
parent504963e6a466bd0c13c6f36f1ca129602151e598 (diff)
downloadgo-56959158331072ed17801aa539a0d6f28064b511.tar.xz
runtime: fix spurious deadlock reporting
Fixes #2337. Unfortunate sequence of events is: 1. maxcpu=2, mcpu=1, grunning=1 2. starttheworld creates an extra M: maxcpu=2, mcpu=2, grunning=1 4. the goroutine calls runtime.GOMAXPROCS(1) maxcpu=1, mcpu=2, grunning=1 5. since it sees mcpu>maxcpu, it calls gosched() 6. schedule() deschedules the goroutine: maxcpu=1, mcpu=1, grunning=0 7. schedule() call getnextandunlock() which fails to pick up the goroutine again, because canaddcpu() fails, because mcpu==maxcpu 8. then it sees that grunning==0, reports deadlock and terminates R=golang-dev, rsc CC=golang-dev https://golang.org/cl/5191044
Diffstat (limited to 'src/pkg/runtime/malloc.h')
-rw-r--r--src/pkg/runtime/malloc.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pkg/runtime/malloc.h b/src/pkg/runtime/malloc.h
index f22cae4b05..eb3bba3431 100644
--- a/src/pkg/runtime/malloc.h
+++ b/src/pkg/runtime/malloc.h
@@ -407,7 +407,7 @@ enum
void runtime·MProf_Malloc(void*, uintptr);
void runtime·MProf_Free(void*, uintptr);
-int32 runtime·helpgc(void);
+int32 runtime·helpgc(bool*);
void runtime·gchelper(void);
// Malloc profiling settings.