1 /* -----------------------------------------------------------------------------
2 * $Id: SchedAPI.h,v 1.2 1998/12/02 13:21:33 simonm 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 * Running the scheduler
20 Killed, /* another thread killed us */
21 Interrupted, /* stopped in response to a call to interruptStgRts */
23 AllBlocked, /* subtly different from Deadlock */
26 SchedulerStatus schedule(StgTSO *main_thread, /*out*/StgClosure **ret);
32 StgTSO *createThread (nat stack_size);
34 static inline void pushClosure (StgTSO *tso, StgClosure *c) {
39 static inline void pushRealWorld (StgTSO *tso) {
41 tso->sp[0] = (W_) REALWORLD_TAG;
43 static inline StgTSO *
44 createGenThread(nat stack_size, StgClosure *closure) {
46 t = createThread(stack_size);
47 pushClosure(t,closure);
51 static inline StgTSO *
52 createIOThread(nat stack_size, StgClosure *closure) {
54 t = createThread(stack_size);
56 pushClosure(t,closure);
64 void deleteThread(StgTSO *tso);
70 void RevertCAFs(void);