Skip to content
Snippets Groups Projects
Commit 2edb4793 authored by Simon Marlow's avatar Simon Marlow
Browse files

[project @ 2000-02-29 14:38:19 by simonmar]

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.
parent 8b64c2c5
No related merge requests found
/* ---------------------------------------------------------------------------
* $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
*
......@@ -347,7 +347,11 @@ schedule( void )
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:
......@@ -369,7 +373,11 @@ schedule( void )
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
*
......@@ -263,7 +263,7 @@ shutdown_handler(int sig STG_UNUSED)
} else
#endif
shutdownHaskellAndExit(EXIT_INTERRUPTED);
interruptStgRts();
}
/*
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment