projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Add non-recursive let-bindings for types
[ghc-hetmet.git]
/
rts
/
RtsStartup.c
diff --git
a/rts/RtsStartup.c
b/rts/RtsStartup.c
index
0ce17fe
..
774de72
100644
(file)
--- a/
rts/RtsStartup.c
+++ b/
rts/RtsStartup.c
@@
-330,7
+330,9
@@
hs_add_root(void (*init_root)(void))
{
bdescr *bd;
nat init_sp;
{
bdescr *bd;
nat init_sp;
- Capability *cap = &MainCapability;
+ Capability *cap;
+
+ cap = rts_lock();
if (hs_init_count <= 0) {
barf("hs_add_root() must be called after hs_init()");
if (hs_init_count <= 0) {
barf("hs_add_root() must be called after hs_init()");
@@
-357,6
+359,8
@@
hs_add_root(void (*init_root)(void))
// ToDo: make this work in the presence of multiple hs_add_root()s.
initProfiling2();
// ToDo: make this work in the presence of multiple hs_add_root()s.
initProfiling2();
+ rts_unlock(cap);
+
// ditto.
#if defined(THREADED_RTS)
ioManagerStart();
// ditto.
#if defined(THREADED_RTS)
ioManagerStart();