summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-12-10 03:55:51 +0000
committerBen Gamari <ben@smart-cactus.org>2020-12-31 15:52:34 -0500
commit5b62aa0d252bf7030230b0e81c5025253faef5f1 (patch)
treedcb585039d1fac1a52bd85ea2039d33fcb56c947
parent191a9d82fe462ae45dc2b13f89fa6a8a3dbfa9ff (diff)
downloadhaskell-5b62aa0d252bf7030230b0e81c5025253faef5f1.tar.gz
nonmoving: Add comments to nonmovingResurrectThreads
(cherry picked from commit 65b702f131a0629a4ff8440754bd1a17f9860e54)
-rw-r--r--rts/sm/NonMovingMark.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c
index f6272282a8..658d743ca1 100644
--- a/rts/sm/NonMovingMark.c
+++ b/rts/sm/NonMovingMark.c
@@ -1929,6 +1929,8 @@ void nonmovingTidyThreads ()
}
}
+// Mark threads which appear to be dead but still need to be properly torn down
+// by resurrectThreads.
void nonmovingResurrectThreads (struct MarkQueue_ *queue, StgTSO **resurrected_threads)
{
StgTSO *next;
@@ -1940,6 +1942,9 @@ void nonmovingResurrectThreads (struct MarkQueue_ *queue, StgTSO **resurrected_t
case ThreadComplete:
continue;
default:
+ // The thread may be, e.g., deadlocked in which case we must ensure
+ // it isn't swept since resurrectThreads will need to throw it an
+ // exception.
markQueuePushClosure_(queue, (StgClosure*)t);
t->global_link = *resurrected_threads;
*resurrected_threads = t;