c5acd2eff5a9b8dcf12ac667372f01e28e96837b
[ghc-hetmet.git] / ghc / rts / hooks / NoRunnableThreads.c
1 /* -----------------------------------------------------------------------------
2  * $Id: NoRunnableThreads.c,v 1.3 2002/07/17 09:21:51 simonmar Exp $
3  *
4  * User-overridable RTS hooks.
5  *
6  * ---------------------------------------------------------------------------*/
7
8 #include "Rts.h"
9
10 #include <stdio.h>
11
12 /*
13   Hook to invoke when there's nothing left on the runnable threads
14   queue {\em and} we've got nothing to wait for. The value
15   returned is the exit code to report back. 
16   
17   NOTE: This hook is really CONCURRENT specific, but we include
18   it in the way-independent libHSclib.a.
19 */
20
21 int
22 NoRunnableThreadsHook (void)
23 {
24     fflush(stdout);
25     fprintf(stderr, "No runnable threads!\n");
26     return(EXIT_FAILURE);
27 }
28