1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2005
5 * Signal processing / handling.
7 * ---------------------------------------------------------------------------*/
12 #if !defined(PAR) && !defined(mingw32_HOST_OS)
14 #define RTS_USER_SIGNALS 1
15 #include "posix/Signals.h"
17 #elif defined(mingw32_HOST_OS)
19 #define RTS_USER_SIGNALS 1
20 #include "win32/ConsoleHandler.h"
24 #define signals_pending() (rtsFalse)
25 #define handleSignalsInThisThread() /* nothing */
33 * Function: initUserSignals()
35 * Initialize the console handling substrate.
37 extern void initUserSignals(void);
40 * Function: initDefaultHandlers()
42 * Install any default signal/console handlers. Currently we install a
43 * Ctrl+C handler that shuts down the RTS in an orderly manner.
45 extern void initDefaultHandlers(void);
48 * Function: blockUserSignals()
50 * Temporarily block the delivery of further console events. Needed to
51 * avoid race conditions when GCing the queue of outstanding handlers or
52 * when emptying the queue by running the handlers.
55 extern void blockUserSignals(void);
58 * Function: unblockUserSignals()
60 * The inverse of blockUserSignals(); re-enable the deliver of console events.
62 extern void unblockUserSignals(void);
65 * Function: awaitUserSignals()
67 * Wait for the next console event. Currently a NOP (returns immediately.)
69 extern void awaitUserSignals(void);
72 * Function: markSignalHandlers()
74 * Evacuate the handler queue. _Assumes_ that console event delivery
75 * has already been blocked.
77 extern void markSignalHandlers (evac_fn evac);
79 #endif /* RTS_USER_SIGNALS */
81 #endif /* RTS_SIGNALS_H */