From ac76dbc441fa9d716109d107e27187c12e7d1946 Mon Sep 17 00:00:00 2001 From: simonmar Date: Fri, 2 Mar 2001 10:52:15 +0000 Subject: [PATCH] [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). --- ghc/rts/Itimer.c | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) 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 */ + } } } -- 1.7.10.4