Commit 9367b24f authored by Simon Marlow's avatar Simon Marlow
Browse files

hs_add_root: use use rts_lock()/rts_unlock() for a bit of extra safety

parent eacbef6d
......@@ -330,7 +330,9 @@ hs_add_root(void (*init_root)(void))
{
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()");
......@@ -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();
rts_unlock(cap);
// ditto.
#if defined(THREADED_RTS)
ioManagerStart();
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment