tidy up conditional forkProcess() support
/* ---------------------------------------------------------------------------
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.193 2004/03/01 14:18:35 simonmar Exp $
+ * $Id: Schedule.c,v 1.194 2004/03/13 00:56:45 sof Exp $
*
* (c) The GHC Team, 1998-2003
*
*
* (c) The GHC Team, 1998-2003
*
* Singleton fork(). Do not copy any running threads.
* ------------------------------------------------------------------------- */
* Singleton fork(). Do not copy any running threads.
* ------------------------------------------------------------------------- */
+#ifndef mingw32_TARGET_OS
+#define FORKPROCESS_PRIMOP_SUPPORTED
+#endif
+
+#ifdef FORKPROCESS_PRIMOP_SUPPORTED
static void
deleteThreadImmediately(StgTSO *tso);
static void
deleteThreadImmediately(StgTSO *tso);
-forkProcess(HsStablePtr *entry)
+forkProcess(HsStablePtr *entry
+#ifndef FORKPROCESS_PRIMOP_SUPPORTED
+ STG_UNUSED
+#endif
+ )
-#ifndef mingw32_TARGET_OS
+#ifdef FORKPROCESS_PRIMOP_SUPPORTED
pid_t pid;
StgTSO* t,*next;
StgMainThread *m;
pid_t pid;
StgTSO* t,*next;
StgMainThread *m;
// wipe the main thread list
while((m = main_threads) != NULL) {
main_threads = m->link;
// wipe the main thread list
while((m = main_threads) != NULL) {
main_threads = m->link;
closeCondition(&m->bound_thread_cond);
closeCondition(&m->bound_thread_cond);
-#ifdef RTS_SUPPORTS_THREADS
+# 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);
hs_exit(); // clean up and exit
stg_exit(0);
}
hs_exit(); // clean up and exit
stg_exit(0);
}
-#else /* mingw32 */
- barf("forkProcess#: primop not implemented for mingw32, sorry!\n");
+#else /* !FORKPROCESS_PRIMOP_SUPPORTED */
+ barf("forkProcess#: primop not supported, sorry!\n");
}
/* ---------------------------------------------------------------------------
}
/* ---------------------------------------------------------------------------
+#ifdef FORKPROCESS_PRIMOP_SUPPORTED
static void
deleteThreadImmediately(StgTSO *tso)
{ // for forkProcess only:
static void
deleteThreadImmediately(StgTSO *tso)
{ // for forkProcess only:
tso->what_next = ThreadKilled;
}
tso->what_next = ThreadKilled;
}
void
raiseAsyncWithLock(StgTSO *tso, StgClosure *exception)
void
raiseAsyncWithLock(StgTSO *tso, StgClosure *exception)