1 /* ---------------------------------------------------------------------------
3 * (c) The GHC Team, 2006
5 * Thread-related functionality
7 * --------------------------------------------------------------------------*/
12 #include "BeginPrivate.h"
14 #define END_BLOCKED_EXCEPTIONS_QUEUE ((MessageThrowTo*)END_TSO_QUEUE)
16 StgTSO * unblockOne (Capability *cap, StgTSO *tso);
17 StgTSO * unblockOne_ (Capability *cap, StgTSO *tso, rtsBool allow_migrate);
19 void checkBlockingQueues (Capability *cap, StgTSO *tso);
20 void wakeBlockingQueue (Capability *cap, StgBlockingQueue *bq);
21 void tryWakeupThread (Capability *cap, StgTSO *tso);
22 void migrateThread (Capability *from, StgTSO *tso, Capability *to);
24 // Wakes up a thread on a Capability (probably a different Capability
25 // from the one held by the current Task).
28 void wakeupThreadOnCapability (Capability *cap,
29 Capability *other_cap,
33 void updateThunk (Capability *cap, StgTSO *tso,
34 StgClosure *thunk, StgClosure *val);
36 rtsBool removeThreadFromQueue (Capability *cap, StgTSO **queue, StgTSO *tso);
37 rtsBool removeThreadFromDeQueue (Capability *cap, StgTSO **head, StgTSO **tail, StgTSO *tso);
39 StgBool isThreadBound (StgTSO* tso);
42 void threadStackOverflow (Capability *cap, StgTSO *tso);
43 nat threadStackUnderflow (Capability *cap, StgTSO *tso);
46 void printThreadBlockage (StgTSO *tso);
47 void printThreadStatus (StgTSO *t);
48 void printAllThreads (void);
49 void printThreadQueue (StgTSO *t);
52 #include "EndPrivate.h"
54 #endif /* THREADS_H */