From: simonmar Date: Fri, 2 Mar 2001 10:52:15 +0000 (+0000) Subject: [project @ 2001-03-02 10:52:15 by simonmar] X-Git-Tag: Approximately_9120_patches~2486 X-Git-Url: http://git.megacz.com/?a=commitdiff_plain;h=ac76dbc441fa9d716109d107e27187c12e7d1946;p=ghc-hetmet.git [project @ 2001-03-02 10:52:15 by simonmar] Don't context switch on the timer if the flag +RTS -C0 is given. This gives us reliable/repeatable runs with -C0 (I've been running with a similar change for months now, debugging is virtually impossible without it). --- diff --git a/ghc/rts/Itimer.c b/ghc/rts/Itimer.c index 812557c..5b10a5b 100644 --- a/ghc/rts/Itimer.c +++ b/ghc/rts/Itimer.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Itimer.c,v 1.21 2001/02/27 12:43:45 rrt Exp $ + * $Id: Itimer.c,v 1.22 2001/03/02 10:52:15 simonmar Exp $ * * (c) The GHC Team, 1995-1999 * @@ -80,10 +80,12 @@ handle_tick(int unused STG_UNUSED) */ ticks_since_timestamp++; - ticks_to_ctxt_switch--; - if (ticks_to_ctxt_switch <= 0) { - ticks_to_ctxt_switch = RtsFlags.ConcFlags.ctxtSwitchTicks; - context_switch = 1; /* schedule a context switch */ + if (RtsFlags.ConcFlags.ctxtSwitchTicks > 0) { + ticks_to_ctxt_switch--; + if (ticks_to_ctxt_switch <= 0) { + ticks_to_ctxt_switch = RtsFlags.ConcFlags.ctxtSwitchTicks; + context_switch = 1; /* schedule a context switch */ + } } }