Un-break non-threaded RTS
(hopefully; I have no time to test it right now)
/* ---------------------------------------------------------------------------
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.177 2003/10/01 10:57:42 wolfgang Exp $
+ * $Id: Schedule.c,v 1.178 2003/10/01 21:16:12 wolfgang Exp $
*
* (c) The GHC Team, 1998-2000
*
*
* (c) The GHC Team, 1998-2000
*
* Singleton fork(). Do not copy any running threads.
* ------------------------------------------------------------------------- */
* Singleton fork(). Do not copy any running threads.
* ------------------------------------------------------------------------- */
static void
deleteThreadImmediately(StgTSO *tso);
static void
deleteThreadImmediately(StgTSO *tso);
StgInt
forkProcess(HsStablePtr *entry)
StgInt
forkProcess(HsStablePtr *entry)
+#ifdef RTS_SUPPORTS_THREADS
resetTaskManagerAfterFork(); // tell startTask() and friends that
startingWorkerThread = rtsFalse; // we have no worker threads any more
resetWorkerWakeupPipeAfterFork();
resetTaskManagerAfterFork(); // tell startTask() and friends that
startingWorkerThread = rtsFalse; // we have no worker threads any more
resetWorkerWakeupPipeAfterFork();
rc = rts_evalStableIO(entry, NULL); // run the action
rts_checkSchedStatus("forkProcess",rc);
rc = rts_evalStableIO(entry, NULL); // run the action
rts_checkSchedStatus("forkProcess",rc);
{
interrupted = 1;
context_switch = 1;
{
interrupted = 1;
context_switch = 1;
+ wakeBlockedWorkerThread();
}
/* -----------------------------------------------------------------------------
}
/* -----------------------------------------------------------------------------
static void
deleteThreadImmediately(StgTSO *tso)
{ // for forkProcess only:
static void
deleteThreadImmediately(StgTSO *tso)
{ // for forkProcess only:
unblockThread(tso);
tso->what_next = ThreadKilled;
}
unblockThread(tso);
tso->what_next = ThreadKilled;
}
void
raiseAsyncWithLock(StgTSO *tso, StgClosure *exception)
void
raiseAsyncWithLock(StgTSO *tso, StgClosure *exception)