summaryrefslogtreecommitdiff
path: root/includes/RtsAPI.h
diff options
context:
space:
mode:
Diffstat (limited to 'includes/RtsAPI.h')
-rw-r--r--includes/RtsAPI.h12
1 files changed, 12 insertions, 0 deletions
diff --git a/includes/RtsAPI.h b/includes/RtsAPI.h
index 6c782e504a..36ab4d4b04 100644
--- a/includes/RtsAPI.h
+++ b/includes/RtsAPI.h
@@ -17,8 +17,10 @@ extern "C" {
#include "HsFFI.h"
#include "rts/Time.h"
+#include "rts/Types.h"
#include "rts/EventLogWriter.h"
+
/*
* Running the scheduler
*/
@@ -566,6 +568,16 @@ void rts_resume (PauseToken *pauseToken);
// Returns true if the rts is paused. See rts_pause() and rts_resume().
bool rts_isPaused(void);
+// List all live threads. The RTS must be paused and this must be called on the
+// same thread that called rts_pause().
+typedef void (*ListThreadsCb)(void *user, StgTSO *);
+void rts_listThreads(ListThreadsCb cb, void *user);
+
+// List all non-thread GC roots. The RTS must be paused and this must be called
+// on the same thread that called rts_pause().
+typedef void (*ListRootsCb)(void *user, StgClosure *);
+void rts_listMiscRoots(ListRootsCb cb, void *user);
+
/*
* The RTS allocates some thread-local data when you make a call into
* Haskell using one of the rts_eval() functions. This data is not