diff --git a/ghc/rts/RtsAPI.c b/ghc/rts/RtsAPI.c index 7ab8b444bc7533861ef68519631ff3c1588186fe..992be891a577aae9b8d07f81021d29dce3d77c58 100644 --- a/ghc/rts/RtsAPI.c +++ b/ghc/rts/RtsAPI.c @@ -1,5 +1,5 @@ /* ---------------------------------------------------------------------------- - * $Id: RtsAPI.c,v 1.16 2000/04/25 14:57:39 simonmar Exp $ + * $Id: RtsAPI.c,v 1.17 2000/04/26 10:17:41 simonmar Exp $ * * (c) The GHC Team, 1998-2000 * @@ -384,11 +384,19 @@ rts_evalNothing(unsigned int stack_size) /* Convenience function for decoding the returned status. */ -void rts_checkSchedStatus ( char* site, SchedulerStatus rc ) -{ - if ( rc == Success ) { - return; - } else { - barf("%s: Return code (%d) not ok",(site),(rc)); - } +void +rts_checkSchedStatus ( char* site, SchedulerStatus rc ) +{ + switch (rc) { + case Success: + return; + case Killed: + barf("%s: uncaught exception",site); + case Interrupted: + barf("%s: interrupted", site); + case Deadlock: + barf("%s: no threads to run: infinite loop or deadlock?", site); + default: + barf("%s: Return code (%d) not ok",(site),(rc)); + } }