Index: src/pkg/runtime/thread_freebsd.c |
=================================================================== |
--- a/src/pkg/runtime/thread_freebsd.c |
+++ b/src/pkg/runtime/thread_freebsd.c |
@@ -121,11 +121,19 @@ |
} |
// Called to initialize a new m (including the bootstrap m). |
+// Called on the parent thread (main thread in case of bootstrap), can allocate memory. |
+void |
+runtime·mpreinit(M *mp) |
+{ |
+ mp->gsignal = runtime·malg(32*1024); |
+} |
+ |
+// Called to initialize a new m (including the bootstrap m). |
+// Called on the new thread, can not allocate memory. |
void |
runtime·minit(void) |
{ |
// Initialize signal handling |
- m->gsignal = runtime·malg(32*1024); |
runtime·signalstack((byte*)m->gsignal->stackguard - StackGuard, 32*1024); |
runtime·sigprocmask(&sigset_none, nil); |
} |