diff --git a/rts/sm/NonMovingMark.c b/rts/sm/NonMovingMark.c index 183c366a56268dc42069bdc3740e14ec7db367c7..16085cb27a0384c1f47a82e18ef638d239bbf8ca 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;