diff options
author | simonmar@microsoft.com <unknown> | 2008-02-28 15:24:03 +0000 |
---|---|---|
committer | simonmar@microsoft.com <unknown> | 2008-02-28 15:24:03 +0000 |
commit | 75927bb04bccb3ada850641939f0842a4168968a (patch) | |
tree | ac03fc487b97841c3da5645ab6dcb589c8b88aaa | |
parent | 65bb9b5ae78ee29100ea6bf5617b0fdbc0a100bd (diff) | |
download | haskell-75927bb04bccb3ada850641939f0842a4168968a.tar.gz |
scavengeTSO might encounter a ThreadRelocated; cope
-rw-r--r-- | rts/sm/Scav.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/rts/sm/Scav.c b/rts/sm/Scav.c index 1640eddabf..9361fb7b71 100644 --- a/rts/sm/Scav.c +++ b/rts/sm/Scav.c @@ -134,8 +134,17 @@ scavenge_fun_srt(const StgInfoTable *info) static void scavengeTSO (StgTSO *tso) { - rtsBool saved_eager = gct->eager_promotion; + rtsBool saved_eager; + + if (tso->what_next == ThreadRelocated) { + // the only way this can happen is if the old TSO was on the + // mutable list. We might have other links to this defunct + // TSO, so we must update its link field. + evacuate((StgClosure**)&tso->_link); + return; + } + saved_eager = gct->eager_promotion; gct->eager_promotion = rtsFalse; if ( tso->why_blocked == BlockedOnMVar |