From a0955a2aa2a2fcd5352f7e517c3f965e24fd8584 Mon Sep 17 00:00:00 2001 From: Dmitriy Vyukov Date: Thu, 21 Feb 2013 16:24:38 +0400 Subject: runtime: split minit() to mpreinit() and minit() mpreinit() is called on the parent thread and with mcache (can allocate memory), minit() is called on the child thread and can not allocate memory. R=golang-dev, rsc CC=golang-dev https://golang.org/cl/7389043 --- src/pkg/runtime/proc.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'src/pkg/runtime/proc.c') diff --git a/src/pkg/runtime/proc.c b/src/pkg/runtime/proc.c index 67d6dad488..5c36ddf745 100644 --- a/src/pkg/runtime/proc.c +++ b/src/pkg/runtime/proc.c @@ -370,6 +370,8 @@ mcommoninit(M *mp) runtime·callers(1, mp->createstack, nelem(mp->createstack)); + runtime·mpreinit(mp); + // Add to runtime·allm so garbage collector doesn't free m // when it is just in a register or thread-local storage. mp->alllink = runtime·allm; -- cgit v1.3-5-g9baa