runtime: fix bug in preemption checks; was causing "lock count" panics

R=r
CC=golang-dev
https://golang.org/cl/186078
This commit is contained in:
Russ Cox 2010-01-12 10:03:02 -08:00
parent 9d4d7d8f99
commit 711088106e
2 changed files with 3 additions and 1 deletions

View file

@ -27,7 +27,7 @@ mallocgc(uintptr size, uint32 refflag, int32 dogc)
void *v;
uint32 *ref;
if(gcwaiting && g != m->g0)
if(gcwaiting && g != m->g0 && m->locks == 0)
gosched();
if(m->mallocing)
throw("malloc/free - deadlock");