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 // like tryWakeupThread(), but assumes the TSO is not ThreadRelocated
25 void tryWakeupThread_ (Capability *cap, StgTSO *tso);
27 // Wakes up a thread on a Capability (probably a different Capability
28 // from the one held by the current Task).
31 void wakeupThreadOnCapability (Capability *cap,
32 Capability *other_cap,
36 void updateThunk (Capability *cap, StgTSO *tso,
37 StgClosure *thunk, StgClosure *val);
39 rtsBool removeThreadFromQueue (Capability *cap, StgTSO **queue, StgTSO *tso);
40 rtsBool removeThreadFromDeQueue (Capability *cap, StgTSO **head, StgTSO **tail, StgTSO *tso);
42 StgBool isThreadBound (StgTSO* tso);
45 void printThreadBlockage (StgTSO *tso);
46 void printThreadStatus (StgTSO *t);
47 void printAllThreads (void);
48 void printThreadQueue (StgTSO *t);
51 #include "EndPrivate.h"
53 #endif /* THREADS_H */