From 3b7d8ea325d0ee614fcc0295fc8f274e9ba68133 Mon Sep 17 00:00:00 2001 From: simonmar Date: Mon, 13 Mar 2000 09:56:31 +0000 Subject: [PATCH] [project @ 2000-03-13 09:56:31 by simonmar] Reset the interrupted flag after an interruption. This allows finalizers to run, and means that Hugs doesn't get stuck in an interruption loop. --- ghc/rts/Schedule.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 7bb65f5..09a2eca 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.48 2000/03/07 11:58:49 simonmar Exp $ + * $Id: Schedule.c,v 1.49 2000/03/13 09:56:31 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -295,6 +295,7 @@ schedule( void ) StgTSO *tso; GlobalTaskId pe; #endif + rtsBool was_interrupted = rtsFalse; ACQUIRE_LOCK(&sched_mutex); @@ -324,6 +325,8 @@ schedule( void ) } run_queue_hd = run_queue_tl = END_TSO_QUEUE; blocked_queue_hd = blocked_queue_tl = END_TSO_QUEUE; + interrupted = rtsFalse; + was_interrupted = rtsTrue; } /* Go through the list of main threads and wake up any @@ -347,7 +350,7 @@ schedule( void ) break; case ThreadKilled: *prev = m->link; - if (interrupted) { + if (was_interrupted) { m->stat = Interrupted; } else { m->stat = Killed; @@ -373,7 +376,7 @@ schedule( void ) m->stat = Success; return; } else { - if (interrupted) { + if (was_interrupted) { m->stat = Interrupted; } else { m->stat = Killed; -- 1.7.10.4