Ctrl-C now interrupts the RTS safely. Previously it called
shutdownHaskellAndExit() from the signal handler directly, which isn't
safe because we may have been interrupted during GC or whatever. Now
we set the interrupted flag and wait for the RTS to shut down by
itself.
/* ---------------------------------------------------------------------------
- * $Id: Schedule.c,v 1.46 2000/01/30 10:25:29 simonmar Exp $
+ * $Id: Schedule.c,v 1.47 2000/02/29 14:38:19 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
break;
case ThreadKilled:
*prev = m->link;
- m->stat = Killed;
+ if (interrupted) {
+ m->stat = Interrupted;
+ } else {
+ m->stat = Killed;
+ }
pthread_cond_broadcast(&m->wakeup);
break;
default:
m->stat = Success;
return;
} else {
- m->stat = Killed;
+ if (interrupted) {
+ m->stat = Interrupted;
+ } else {
+ m->stat = Killed;
+ }
return;
}
}
/* -----------------------------------------------------------------------------
- * $Id: Signals.c,v 1.13 2000/02/22 12:09:23 simonmar Exp $
+ * $Id: Signals.c,v 1.14 2000/02/29 14:38:19 simonmar Exp $
*
* (c) The GHC Team, 1998-1999
*
} else
#endif
- shutdownHaskellAndExit(EXIT_INTERRUPTED);
+ interruptStgRts();
}
/*