1 /* -----------------------------------------------------------------------------
2 * $Id: SchedAPI.h,v 1.6 1999/07/06 09:42:39 sof Exp $
4 * (c) The GHC Team 1998
6 * External API for the scheduler. For most uses, the functions in
7 * RtsAPI.h should be enough.
9 * ---------------------------------------------------------------------------*/
15 * schedule() plus the thread creation functions are not part
16 * part of the external RTS API, so leave them out if we're
17 * not compiling rts/ bits. -- sof 7/99
20 SchedulerStatus schedule(StgTSO *main_thread, /*out*/StgClosure **ret);
26 StgTSO *createThread (nat stack_size);
28 static inline void pushClosure (StgTSO *tso, StgClosure *c) {
33 static inline void pushRealWorld (StgTSO *tso) {
35 tso->sp[0] = (W_) REALWORLD_TAG;
37 static inline StgTSO *
38 createGenThread(nat stack_size, StgClosure *closure) {
40 t = createThread(stack_size);
41 pushClosure(t,closure);
45 static inline StgTSO *
46 createIOThread(nat stack_size, StgClosure *closure) {
48 t = createThread(stack_size);
50 pushClosure(t,closure);
55 * Same as above, but also evaluate the result of the IO action
56 * to whnf while we're at it.
59 static inline StgTSO *
60 createStrictIOThread(nat stack_size, StgClosure *closure) {
62 t = createThread(stack_size);
63 pushClosure(t,closure);
64 pushClosure(t,(StgClosure*)&forceIO_closure);
73 void deleteThread(StgTSO *tso);
79 void RevertCAFs(void);