summaryrefslogtreecommitdiff
path: root/includes/rts/Threads.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/rts/Threads.h')
-rw-r--r--includes/rts/Threads.h47
1 files changed, 47 insertions, 0 deletions
diff --git a/includes/rts/Threads.h b/includes/rts/Threads.h
new file mode 100644
index 0000000000..06a0ed11dc
--- /dev/null
+++ b/includes/rts/Threads.h
@@ -0,0 +1,47 @@
+/* -----------------------------------------------------------------------------
+ *
+ * (c) The GHC Team 1998-2009
+ *
+ * External API for the scheduler. For most uses, the functions in
+ * RtsAPI.h should be enough.
+ *
+ * ---------------------------------------------------------------------------*/
+
+#ifndef RTS_THREADS_H
+#define RTS_THREADS_H
+
+//
+// Creating threads
+//
+StgTSO *createThread (Capability *cap, nat stack_size);
+
+Capability *scheduleWaitThread (StgTSO *tso, /*out*/HaskellObj* ret,
+ Capability *cap);
+
+StgTSO *createGenThread (Capability *cap, nat stack_size,
+ StgClosure *closure);
+StgTSO *createIOThread (Capability *cap, nat stack_size,
+ StgClosure *closure);
+StgTSO *createStrictIOThread (Capability *cap, nat stack_size,
+ StgClosure *closure);
+
+// Suspending/resuming threads around foreign calls
+void * suspendThread (StgRegTable *);
+StgRegTable * resumeThread (void *);
+
+//
+// Thread operations from Threads.c
+//
+int cmp_thread (StgPtr tso1, StgPtr tso2);
+int rts_getThreadId (StgPtr tso);
+pid_t forkProcess (HsStablePtr *entry);
+HsBool rtsSupportsBoundThreads (void);
+
+// The number of Capabilities
+extern unsigned int n_capabilities;
+
+#if !IN_STG_CODE
+extern Capability MainCapability;
+#endif
+
+#endif /* RTS_THREADS_H */