1 /* -----------------------------------------------------------------------------
2 * $Id: Schedule.h,v 1.5 1999/03/16 13:20:17 simonm Exp $
4 * (c) The GHC Team 1998-1999
6 * Prototypes for functions in Schedule.c
7 * (RTS internal scheduler interface)
9 * ---------------------------------------------------------------------------*/
15 void initScheduler(void);
21 void awaken_blocked_queue(StgTSO *tso);
22 void initThread(StgTSO *tso, nat stack_size);
23 void interruptStgRts(void);
24 void raiseAsync(StgTSO *tso, StgClosure *exception);
26 extern nat context_switch;
28 extern StgTSO *run_queue_hd, *run_queue_tl;
29 extern StgTSO *blocked_queue_hd, *blocked_queue_tl;
31 #ifdef COMPILING_RTS_MAIN
32 extern DLLIMPORT StgTSO *MainTSO; /* temporary hack */
34 extern StgTSO *MainTSO; /* temporary hack */
36 #define END_TSO_QUEUE ((StgTSO *)(void*)&END_TSO_QUEUE_closure)
38 #define PUSH_ON_RUN_QUEUE(tso) \
39 if (run_queue_hd == END_TSO_QUEUE) { \
42 run_queue_tl->link = tso; \
46 #define END_CAF_LIST stgCast(StgCAF*,(void*)&END_TSO_QUEUE_closure)