summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGHC GitLab CI <ghc-ci@gitlab-haskell.org>2020-12-10 03:55:51 +0000
committerBen Gamari <ben@well-typed.com>2020-12-20 21:05:13 -0500
commit65b702f131a0629a4ff8440754bd1a17f9860e54 (patch)
tree97b4ca1989a676c39141a84be02400903d22e9d1
parenta2731d49d95f7397a6a267a322ed75b0c3a5c246 (diff)
downloadhaskell-65b702f131a0629a4ff8440754bd1a17f9860e54.tar.gz
nonmoving: Add comments to nonmovingResurrectThreads
-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;