Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(57)

Unified Diff: src/pkg/runtime/thread_freebsd.c

Issue 7389043: code review 7389043: runtime: split minit() to mpreinit() and minit() (Closed)
Patch Set: diff -r 3391481b6373 https://dvyukov%40google.com@code.google.com/p/go/ Created 12 years ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « src/pkg/runtime/thread_darwin.c ('k') | src/pkg/runtime/thread_linux.c » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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);
}
« no previous file with comments | « src/pkg/runtime/thread_darwin.c ('k') | src/pkg/runtime/thread_linux.c » ('j') | no next file with comments »

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b