1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team 1998-2009
5 * External API for the scheduler. For most uses, the functions in
6 * RtsAPI.h should be enough.
8 * Do not #include this file directly: #include "Rts.h" instead.
10 * To understand the structure of the RTS headers, see the wiki:
11 * http://hackage.haskell.org/trac/ghc/wiki/Commentary/SourceTree/Includes
13 * ---------------------------------------------------------------------------*/
21 StgTSO *createThread (Capability *cap, nat stack_size);
23 Capability *scheduleWaitThread (StgTSO *tso, /*out*/HaskellObj* ret,
26 StgTSO *createGenThread (Capability *cap, nat stack_size,
28 StgTSO *createIOThread (Capability *cap, nat stack_size,
30 StgTSO *createStrictIOThread (Capability *cap, nat stack_size,
33 // Suspending/resuming threads around foreign calls
34 void * suspendThread (StgRegTable *, rtsBool interruptible);
35 StgRegTable * resumeThread (void *);
38 // Thread operations from Threads.c
40 int cmp_thread (StgPtr tso1, StgPtr tso2);
41 int rts_getThreadId (StgPtr tso);
43 #if !defined(mingw32_HOST_OS)
44 pid_t forkProcess (HsStablePtr *entry);
46 pid_t forkProcess (HsStablePtr *entry)
47 GNU_ATTRIBUTE(__noreturn__);
50 HsBool rtsSupportsBoundThreads (void);
52 // The number of Capabilities
53 extern unsigned int n_capabilities;
56 extern Capability MainCapability;
59 #endif /* RTS_THREADS_H */