mirror of
https://github.com/golang/go
synced 2024-11-21 16:04:45 -07:00
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:
parent
9d4d7d8f99
commit
711088106e
@ -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");
|
||||
|
@ -523,6 +523,8 @@ scheduler(void)
|
||||
void
|
||||
gosched(void)
|
||||
{
|
||||
if(m->locks != 0)
|
||||
throw("gosched holding locks");
|
||||
if(g == m->g0)
|
||||
throw("gosched of g0");
|
||||
if(gosave(&g->sched) == 0)
|
||||
|
Loading…
Reference in New Issue
Block a user