summaryrefslogtreecommitdiff
path: root/rts/Threads.h
blob: d17235a2cbfaff890fc7d185adf8682da8c6e0a1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/* ---------------------------------------------------------------------------
 *
 * (c) The GHC Team, 2006
 *
 * Thread-related functionality
 *
 * --------------------------------------------------------------------------*/

#ifndef THREADS_H
#define THREADS_H

StgTSO * unblockOne (Capability *cap, StgTSO *tso);
StgTSO * unblockOne_ (Capability *cap, StgTSO *tso, rtsBool allow_migrate);

void awakenBlockedQueue (Capability *cap, StgTSO *tso);

void removeThreadFromMVarQueue (Capability *cap, StgMVar *mvar, StgTSO *tso);
void removeThreadFromQueue     (Capability *cap, StgTSO **queue, StgTSO *tso);
void removeThreadFromDeQueue   (Capability *cap, StgTSO **head, StgTSO **tail, StgTSO *tso);

StgBool isThreadBound (StgTSO* tso);

#ifdef DEBUG
void printThreadBlockage (StgTSO *tso);
void printThreadStatus (StgTSO *t);
void printAllThreads (void);
void printThreadQueue (StgTSO *t);
#endif

#endif /* THREADS_H */