X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRtsStartup.c;h=19e1b3e2bee559fadcfc28584c0621e050dda9c4;hb=e1dffdbe9a546b4ea6170ad4c1bf647477fe6b29;hp=1c50c08c4a69fdc0a3ff55f248a465342462c5a7;hpb=d1a47b329fd21ab5a7db1dbe47959a874e8648e6;p=ghc-hetmet.git diff --git a/ghc/rts/RtsStartup.c b/ghc/rts/RtsStartup.c index 1c50c08..19e1b3e 100644 --- a/ghc/rts/RtsStartup.c +++ b/ghc/rts/RtsStartup.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: RtsStartup.c,v 1.16 1999/07/03 18:39:40 sof Exp $ + * $Id: RtsStartup.c,v 1.19 1999/09/13 11:02:08 sof Exp $ * * (c) The GHC Team, 1998-1999 * @@ -15,6 +15,8 @@ #include "StablePriv.h" /* initStablePtrTable */ #include "Schedule.h" /* initScheduler */ #include "Stats.h" /* initStats */ +#include "Signals.h" +#include "Itimer.h" #include "Weak.h" #include "Ticky.h" @@ -110,13 +112,18 @@ startupHaskell(int argc, char *argv[]) initProfiling(); #endif + /* start the ticker */ + install_vtalrm_handler(); + initialize_virtual_timer(TICK_MILLISECS); + /* Initialise the scheduler */ initScheduler(); /* Initialise the stats department */ initStats(); -#if 0 + /* Initialise the user signal handler set */ +#if !defined(mingw32_TARGET_OS) && !defined(PAR) initUserSignals(); #endif @@ -148,6 +155,7 @@ startupHaskell(int argc, char *argv[]) void shutdownHaskellAndExit(int n) { + OnExitHook(); shutdownHaskell(); stg_exit(n); } @@ -170,6 +178,9 @@ shutdownHaskell(void) /* clean up things from the storage manager's point of view */ exitStorage(); + /* stop the ticker */ + initialize_virtual_timer(0); + #if defined(PROFILING) || defined(DEBUG) endProfiling(); #endif @@ -187,7 +198,7 @@ shutdownHaskell(void) /* - * called from STG-land to exit the program cleanly + * called from STG-land to exit the program */ void @@ -196,7 +207,7 @@ stg_exit(I_ n) #ifdef PAR par_exit(n); #else - OnExitHook(); exit(n); #endif } +