From 657dfc15ed3bea1ab84bc7ea3ddf3b24ec7f7397 Mon Sep 17 00:00:00 2001 From: simonmar Date: Wed, 23 Aug 2000 12:51:03 +0000 Subject: [PATCH] [project @ 2000-08-23 12:51:03 by simonmar] Fix a problem where ^C wasn't recognised while waiting for I/O. --- ghc/rts/Schedule.c | 6 ++++-- ghc/rts/Select.c | 10 ++++++++-- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/ghc/rts/Schedule.c b/ghc/rts/Schedule.c index 39cd819..eaf4d45 100644 --- a/ghc/rts/Schedule.c +++ b/ghc/rts/Schedule.c @@ -1,5 +1,5 @@ /* --------------------------------------------------------------------------- - * $Id: Schedule.c,v 1.76 2000/08/15 14:18:43 simonmar Exp $ + * $Id: Schedule.c,v 1.77 2000/08/23 12:51:03 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -514,7 +514,9 @@ schedule( void ) #endif ); } - + /* we can be interrupted while waiting for I/O... */ + if (interrupted) continue; + /* check for signals each time around the scheduler */ #ifndef mingw32_TARGET_OS if (signals_pending()) { diff --git a/ghc/rts/Select.c b/ghc/rts/Select.c index 79b21ba..0d1a380 100644 --- a/ghc/rts/Select.c +++ b/ghc/rts/Select.c @@ -1,5 +1,5 @@ /* ----------------------------------------------------------------------------- - * $Id: Select.c,v 1.12 2000/04/03 15:24:21 rrt Exp $ + * $Id: Select.c,v 1.13 2000/08/23 12:51:03 simonmar Exp $ * * (c) The GHC Team 1995-1999 * @@ -171,6 +171,12 @@ awaitEvent(rtsBool wait) break; } + if (interrupted) { + RELEASE_LOCK(&sched_mutex); + select_succeeded = rtsFalse; + break; + } + /* If new runnable threads have arrived, stop waiting for * I/O and run them. */ @@ -270,6 +276,6 @@ awaitEvent(rtsBool wait) blocked_queue_tl = prev; } - } while (wait && run_queue_hd == END_TSO_QUEUE); + } while (wait && !interrupted && run_queue_hd == END_TSO_QUEUE); #endif } -- 1.7.10.4