]> Cypherpunks repositories - gostls13.git/commitdiff
runtime: prepare for M's running w/o mcache
authorDmitriy Vyukov <dvyukov@google.com>
Wed, 20 Feb 2013 17:17:56 +0000 (21:17 +0400)
committerDmitriy Vyukov <dvyukov@google.com>
Wed, 20 Feb 2013 17:17:56 +0000 (21:17 +0400)
Can not happen ATM. In preparation for the new scheduler.

R=golang-dev, rsc
CC=golang-dev
https://golang.org/cl/7388043

src/pkg/runtime/panic.c

index a0651e4ad55e8d4d0804ddc39d8adbcbfe003986..603ff62eb3cc83fad1b6a2066fd47a3b12fd7ec1 100644 (file)
@@ -382,6 +382,8 @@ nomatch:
 void
 runtime·startpanic(void)
 {
+       if(m->mcache == nil)  // can happen if called from signal handler or throw
+               m->mcache = runtime·allocmcache();
        if(m->dying) {
                runtime·printf("panic during panic\n");
                runtime·exit(3);