[project @ 2001-03-02 10:52:15 by simonmar]
authorsimonmar <unknown>
Fri, 2 Mar 2001 10:52:15 +0000 (10:52 +0000)
committersimonmar <unknown>
Fri, 2 Mar 2001 10:52:15 +0000 (10:52 +0000)
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

index 812557c..5b10a5b 100644 (file)
@@ -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 */
+      }
   }
 }