1 /* -----------------------------------------------------------------------------
3 * (c) The GHC Team, 1998-2005
5 * Signal processing / handling.
7 * ---------------------------------------------------------------------------*/
12 #if !defined(mingw32_HOST_OS)
14 #include "posix/Signals.h"
16 #elif defined(mingw32_HOST_OS)
18 #include "win32/ConsoleHandler.h"
22 #define signals_pending() (rtsFalse)
29 * Function: initUserSignals()
31 * Initialize the console handling substrate.
33 extern void initUserSignals(void);
36 * Function: initDefaultHandlers()
38 * Install any default signal/console handlers. Currently we install a
39 * Ctrl+C handler that shuts down the RTS in an orderly manner.
41 extern void initDefaultHandlers(void);
42 extern void resetDefaultHandlers(void);
44 extern void freeSignalHandlers(void);
47 * Function: blockUserSignals()
49 * Temporarily block the delivery of further console events. Needed to
50 * avoid race conditions when GCing the queue of outstanding handlers or
51 * when emptying the queue by running the handlers.
54 extern void blockUserSignals(void);
57 * Function: unblockUserSignals()
59 * The inverse of blockUserSignals(); re-enable the deliver of console events.
61 extern void unblockUserSignals(void);
64 * Function: awaitUserSignals()
66 * Wait for the next console event. Currently a NOP (returns immediately.)
68 extern void awaitUserSignals(void);
71 * Function: markSignalHandlers()
73 * Evacuate the handler queue. _Assumes_ that console event delivery
74 * has already been blocked.
76 extern void markSignalHandlers (evac_fn evac, void *user);
78 #endif /* RTS_USER_SIGNALS */
80 #endif /* RTSSIGNALS_H */