mirror of https://github.com/golang/go.git
runtime: prevent garbage collection during hashmap insertion (fix 2)
Fixes #5074 in multi-threaded scenarios. R=golang-dev, daniel.morsing, dave, dvyukov, bradfitz, rsc CC=golang-dev, remyoudompheng https://golang.org/cl/7916043
This commit is contained in:
parent
bd21f7f1b5
commit
2001f0c28e
|
|
@ -35,7 +35,7 @@ runtime·mallocgc(uintptr size, uint32 flag, int32 dogc, int32 zeroed)
|
|||
MSpan *s;
|
||||
void *v;
|
||||
|
||||
if(runtime·gcwaiting && g != m->g0 && m->locks == 0)
|
||||
if(runtime·gcwaiting && g != m->g0 && m->locks == 0 && dogc)
|
||||
runtime·gosched();
|
||||
if(m->mallocing)
|
||||
runtime·throw("malloc/free - deadlock");
|
||||
|
|
|
|||
Loading…
Reference in New Issue