From 619cd23c12cc4074b679bce4d8a005e5f42ccadf Mon Sep 17 00:00:00 2001
From: sof <unknown>
Date: Fri, 15 Feb 2002 07:37:55 +0000
Subject: [PATCH] [project @ 2002-02-15 07:37:55 by sof] Distinguish between
 the scheduling of a new thread from within the RTS (e.g., via forkIO, running
 finalizers etc) and scheduling of a thread that's created via the RtsAPI --
 the latter now uses scheduleExtThread(), the rest scheduleThread().

Why the distinction? Because the former will in threaded builds create
a worker OS thread, while the latter won't. (There's an added
wrinkle -- main() will also use scheduleThread()).
---
 ghc/includes/SchedAPI.h | 19 +++++++------------
 1 file changed, 7 insertions(+), 12 deletions(-)

diff --git a/ghc/includes/SchedAPI.h b/ghc/includes/SchedAPI.h
index 0a53fa8ede95..cff23251a8a2 100644
--- a/ghc/includes/SchedAPI.h
+++ b/ghc/includes/SchedAPI.h
@@ -1,5 +1,5 @@
 /* -----------------------------------------------------------------------------
- * $Id: SchedAPI.h,v 1.13 2001/03/22 03:51:09 hwloidl Exp $
+ * $Id: SchedAPI.h,v 1.14 2002/02/15 07:37:55 sof Exp $
  *
  * (c) The GHC Team 1998
  *
@@ -16,26 +16,21 @@
 #define NO_PRI  0
 #endif
 
-/* 
- * schedule() plus the thread creation functions are not part
- * part of the external RTS API, so leave them out if we're
- * not compiling rts/ bits.   -- sof 7/99
- * 
- */
-SchedulerStatus waitThread(StgTSO *main_thread, /*out*/StgClosure **ret);
+extern SchedulerStatus waitThread(StgTSO *main_thread, /*out*/StgClosure **ret);
 
 /* 
  * Creating threads
  */
 #if defined(GRAN)
-StgTSO *createThread(nat stack_size, StgInt pri);
+extern StgTSO *createThread(nat stack_size, StgInt pri);
 #else
-StgTSO *createThread(nat stack_size);
+extern StgTSO *createThread(nat stack_size);
 #endif
 #if defined(PAR) || defined(SMP)
-void taskStart(void);
+extern void taskStart(void);
 #endif
-void scheduleThread(StgTSO *tso);
+extern void scheduleThread(StgTSO *tso);
+extern void scheduleExtThread(StgTSO *tso);
 
 static inline void pushClosure   (StgTSO *tso, StgClosure *c) {
   tso->sp--;
-- 
GitLab