projects
/
ghc-hetmet.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
[project @ 2002-05-14 08:17:38 by matthewc]
[ghc-hetmet.git]
/
ghc
/
rts
/
RtsStartup.c
diff --git
a/ghc/rts/RtsStartup.c
b/ghc/rts/RtsStartup.c
index
51b1ec9
..
27ee47c
100644
(file)
--- a/
ghc/rts/RtsStartup.c
+++ b/
ghc/rts/RtsStartup.c
@@
-1,5
+1,5
@@
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.58 2001/11/27 01:51:23 sof Exp $
+ * $Id: RtsStartup.c,v 1.63 2002/05/11 00:16:12 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
@@
-86,10
+86,15
@@
void
startupHaskell(int argc, char *argv[], void (*init_root)(void))
{
/* To avoid repeated initialisations of the RTS */
startupHaskell(int argc, char *argv[], void (*init_root)(void))
{
/* To avoid repeated initialisations of the RTS */
- if (rts_has_started_up)
- return;
- else
- rts_has_started_up=1;
+ if (rts_has_started_up) {
+ /* RTS is up and running, so only run the per-module initialisation code */
+ if (init_root) {
+ initModules(init_root);
+ }
+ return;
+ } else {
+ rts_has_started_up=1;
+ }
/* The very first thing we do is grab the start time...just in case we're
* collecting timing statistics.
/* The very first thing we do is grab the start time...just in case we're
* collecting timing statistics.
@@
-165,11
+170,6
@@
startupHaskell(int argc, char *argv[], void (*init_root)(void))
/* start the virtual timer 'subsystem'. */
startVirtTimer(TICK_MILLISECS);
/* start the virtual timer 'subsystem'. */
startVirtTimer(TICK_MILLISECS);
- /* start our haskell execution tasks */
-#ifdef SMP
- startTasks();
-#endif
-
/* Initialise the stats department */
initStats();
/* Initialise the stats department */
initStats();
@@
-233,7
+233,7
@@
initModules ( void (*init_root)(void) )
#endif
init_sp = 0;
#endif
init_sp = 0;
- bd = allocGroup(4);
+ bd = allocGroup(INIT_STACK_BLOCKS);
init_stack = (F_ *)bd->start;
init_stack[init_sp++] = (F_)stg_init_ret;
init_stack[init_sp++] = (F_)__stginit_Prelude;
init_stack = (F_ *)bd->start;
init_stack[init_sp++] = (F_)stg_init_ret;
init_stack[init_sp++] = (F_)__stginit_Prelude;
@@
-272,10
+272,14
@@
shutdownHaskell(void)
{
if (!rts_has_started_up)
return;
{
if (!rts_has_started_up)
return;
-
+ rts_has_started_up=0;
+
/* start timing the shutdown */
stat_startExit();
/* start timing the shutdown */
stat_startExit();
+ /* stop all running tasks */
+ exitScheduler();
+
#if !defined(GRAN)
/* Finalize any remaining weak pointers */
finalizeWeakPointersNow();
#if !defined(GRAN)
/* Finalize any remaining weak pointers */
finalizeWeakPointersNow();
@@
-287,9
+291,6
@@
shutdownHaskell(void)
end_gr_simulation();
#endif
end_gr_simulation();
#endif
- /* stop all running tasks */
- exitScheduler();
-
/* stop the ticker */
stopVirtTimer();
/* stop the ticker */
stopVirtTimer();
@@
-321,7
+322,7
@@
shutdownHaskell(void)
#endif
#if defined(PROFILING)
#endif
#if defined(PROFILING)
- report_ccs_profiling();
+ reportCCSProfiling();
#endif
#if defined(PROFILING) || defined(DEBUG)
#endif
#if defined(PROFILING) || defined(DEBUG)
@@
-338,8
+339,6
@@
shutdownHaskell(void)
#if defined(TICKY_TICKY)
if (RtsFlags.TickyFlags.showTickyStats) PrintTickyInfo();
#endif
#if defined(TICKY_TICKY)
if (RtsFlags.TickyFlags.showTickyStats) PrintTickyInfo();
#endif
-
- rts_has_started_up=0;
}
/*
}
/*