When the OS thread is all out of work, shut down in a gentler
manner by calling shutdownHaskell() rather than
shutdownHaskellAndExit(). Give up the sched_mutex lock also.
/* -----------------------------------------------------------------------------
/* -----------------------------------------------------------------------------
- * $Id: RtsStartup.c,v 1.61 2002/02/04 20:25:39 sof Exp $
+ * $Id: RtsStartup.c,v 1.62 2002/04/26 22:35:55 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
{
if (!rts_has_started_up)
return;
{
if (!rts_has_started_up)
return;
/* start timing the shutdown */
stat_startExit();
/* start timing the shutdown */
stat_startExit();
#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;
/* ---------------------------------------------------------------------------
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.140 2002/04/23 14:20:18 sof Exp $
+ * $Id: Schedule.c,v 1.141 2002/04/26 22:35:54 sof Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
/* ToDo: revisit conditions (and mechanism) for shutting
down a multi-threaded world */
IF_DEBUG(scheduler, sched_belch("all done, i think...shutting down."));
/* ToDo: revisit conditions (and mechanism) for shutting
down a multi-threaded world */
IF_DEBUG(scheduler, sched_belch("all done, i think...shutting down."));
- shutdownHaskellAndExit(0);
+ RELEASE_LOCK(&sched_mutex);
+ shutdownHaskell();
+ return;
- IF_DEBUG(scheduler, sched_belch("sfoo"));
do {
waitCondition(&m->wakeup, &sched_mutex);
} while (m->stat == NoStatus);
do {
waitCondition(&m->wakeup, &sched_mutex);
} while (m->stat == NoStatus);