[Git][ghc/ghc][wip/ghc-debug] Add comments to RtsApi functions

Sven Tennie gitlab at gitlab.haskell.org
Thu May 21 14:44:33 UTC 2020



Sven Tennie pushed to branch wip/ghc-debug at Glasgow Haskell Compiler / GHC


Commits:
1589e28f by Sven Tennie at 2020-05-21T16:44:14+02:00
Add comments to RtsApi functions

- - - - -


1 changed file:

- rts/RtsAPI.c


Changes:

=====================================
rts/RtsAPI.c
=====================================
@@ -660,14 +660,18 @@ RtsPaused rts_pause (void)
     return paused;
 }
 
-void rts_unpause (RtsPaused  paused)
+// Counterpart of rts_pause: Continue from a pause.
+void rts_unpause (RtsPaused paused)
 {
     rts_paused = false;
     releaseAllCapabilities(n_capabilities, paused.capabilities, paused.pausing_task);
     freeTask(paused.pausing_task);
 }
 
-
+// Call cb for all StgTSOs. *user is a user defined payload to cb. It's not
+// used by the RTS.
+// rts_listThreads should only be called when the RTS is paused, i.e. rts_pause
+// was called before.
 void rts_listThreads(ListThreadsCb cb, void *user)
 {
     ASSERT(rts_paused);
@@ -691,6 +695,11 @@ static void list_roots_helper(void *user, StgClosure **p) {
     ctx->cb(ctx->user, *p);
 }
 
+// Call cb for all StgClosures reachable from threadStableNameTable and
+// threadStablePtrTable. *user is a user defined payload to cb. It's not
+// used by the RTS.
+// rts_listMiscRoots should only be called when the RTS is paused, i.e.
+// rts_pause was called before.
 void rts_listMiscRoots (ListRootsCb cb, void *user)
 {
     struct list_roots_ctx ctx;
@@ -713,7 +722,7 @@ RtsPaused rts_pause (void)
     return paused;
 }
 
-void rts_unpause (RtsPaused  paused STG_UNUSED)
+void rts_unpause (RtsPaused paused STG_UNUSED)
 {
     errorBelch("Warning: Unpausing the RTS is only possible for "
                "multithreaded RTS.");



View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1589e28f72298023c15915792408bd26ba9f61bc

-- 
View it on GitLab: https://gitlab.haskell.org/ghc/ghc/-/commit/1589e28f72298023c15915792408bd26ba9f61bc
You're receiving this email because of your account on gitlab.haskell.org.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.haskell.org/pipermail/ghc-commits/attachments/20200521/673ba06c/attachment-0001.html>


More information about the ghc-commits mailing list