X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=rts%2FRtsStartup.c;h=4f42823d4ae5f7dc946022b877b896c5118c6835;hb=52f600c8ea0bf0d9b4c01570e80d70bfa65c43ba;hp=cdb45c60f2ca68c385d0691c8ddfeca9f5e28998;hpb=8d71be7cbd079f5eab23484a53a43b59dd0399e5;p=ghc-hetmet.git diff --git a/rts/RtsStartup.c b/rts/RtsStartup.c index cdb45c6..4f42823 100644 --- a/rts/RtsStartup.c +++ b/rts/RtsStartup.c @@ -33,6 +33,7 @@ #include "RtsTypeable.h" #include "Stable.h" #include "Hpc.h" +#include "FileLock.h" #if defined(RTS_GTK_FRONTPANEL) #include "FrontPanel.h" @@ -238,6 +239,11 @@ hs_init(int *argc, char **argv[]) /* initialise the shared Typeable store */ initTypeableStore(); + /* initialise file locking, if necessary */ +#if !defined(mingw32_HOST_OS) + initFileLocking(); +#endif + #if defined(DEBUG) /* initialise thread label table (tso->char*) */ initThreadLabelTable(); @@ -275,10 +281,6 @@ hs_init(int *argc, char **argv[]) x86_init_fpu(); #endif -#if defined(THREADED_RTS) - ioManagerStart(); -#endif - /* Record initialization times */ stat_endInit(); } @@ -354,6 +356,11 @@ hs_add_root(void (*init_root)(void)) // This must be done after module initialisation. // ToDo: make this work in the presence of multiple hs_add_root()s. initProfiling2(); + + // ditto. +#if defined(THREADED_RTS) + ioManagerStart(); +#endif } /* ---------------------------------------------------------------------------- @@ -462,6 +469,11 @@ hs_exit_(rtsBool wait_foreign) /* free shared Typeable store */ exitTypeableStore(); + /* free file locking tables, if necessary */ +#if !defined(mingw32_HOST_OS) + freeFileLocking(); +#endif + /* free the stable pointer table */ exitStablePtrTable();