/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.16 1999/07/03 18:39:40 sof Exp $
+ * $Id: RtsStartup.c,v 1.21 1999/09/22 11:53:33 sof Exp $
*
* (c) The GHC Team, 1998-1999
*
#include "StablePriv.h" /* initStablePtrTable */
#include "Schedule.h" /* initScheduler */
#include "Stats.h" /* initStats */
+#include "Signals.h"
+#include "Itimer.h"
#include "Weak.h"
#include "Ticky.h"
#if defined(PROFILING)
# include "ProfRts.h"
-#elif defined(DEBUG)
-# include "DebugProf.h"
+# include "ProfHeap.h"
#endif
#ifdef PAR
initProfiling();
#endif
+ /* start the ticker */
+ install_vtalrm_handler();
+ initialize_virtual_timer(TICK_MILLISECS);
+
/* Initialise the scheduler */
initScheduler();
/* Initialise the stats department */
initStats();
-#if 0
+#if !defined(mingw32_TARGET_OS) && !defined(PAR)
+ /* Initialise the user signal handler set */
initUserSignals();
+ /* Set up handler to run on SIGINT */
+ init_shutdown_handler();
#endif
/* When the RTS and Prelude live in separate DLLs,
void
shutdownHaskellAndExit(int n)
{
+ OnExitHook();
shutdownHaskell();
stg_exit(n);
}
/* 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
/*
- * called from STG-land to exit the program cleanly
+ * called from STG-land to exit the program
*/
void
#ifdef PAR
par_exit(n);
#else
- OnExitHook();
exit(n);
#endif
}
+