From: Simon Marlow Date: Sun, 13 Dec 2009 20:12:46 +0000 (+0000) Subject: If ACTIVITY_INACTIVE is set, wait for GC before resetting it X-Git-Url: http://git.megacz.com/?p=ghc-hetmet.git;a=commitdiff_plain;h=5308c0423b613e0d6a22996e2052731f0a371475 If ACTIVITY_INACTIVE is set, wait for GC before resetting it I don't think this fixes any real bugs, but there's a small possibility that when the RTS is woken up for an idle-time GC, the IO manager thread might be pre-empted which would prevent the idle GC from happening; this change ensures that the idle GC happens anyway. --- diff --git a/rts/Schedule.c b/rts/Schedule.c index cfdb392..72086e8 100644 --- a/rts/Schedule.c +++ b/rts/Schedule.c @@ -463,7 +463,11 @@ run_thread: if (prev == ACTIVITY_DONE_GC) { startTimer(); } - } else { + } else if (recent_activity != ACTIVITY_INACTIVE) { + // If we reached ACTIVITY_INACTIVE, then don't reset it until + // we've done the GC. The thread running here might just be + // the IO manager thread that handle_tick() woke up via + // wakeUpRts(). recent_activity = ACTIVITY_YES; } #endif