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)
28 #pragma GCC visibility push(hidden)
31 * Function: initUserSignals()
33 * Initialize the console handling substrate.
35 void initUserSignals(void);
38 * Function: initDefaultHandlers()
40 * Install any default signal/console handlers. Currently we install a
41 * Ctrl+C handler that shuts down the RTS in an orderly manner.
43 void initDefaultHandlers(void);
44 void resetDefaultHandlers(void);
46 void freeSignalHandlers(void);
49 * Function: blockUserSignals()
51 * Temporarily block the delivery of further console events. Needed to
52 * avoid race conditions when GCing the queue of outstanding handlers or
53 * when emptying the queue by running the handlers.
56 void blockUserSignals(void);
59 * Function: unblockUserSignals()
61 * The inverse of blockUserSignals(); re-enable the deliver of console events.
63 void unblockUserSignals(void);
66 * Function: awaitUserSignals()
68 * Wait for the next console event. Currently a NOP (returns immediately.)
70 void awaitUserSignals(void);
73 * Function: markSignalHandlers()
75 * Evacuate the handler queue. _Assumes_ that console event delivery
76 * has already been blocked.
78 void markSignalHandlers (evac_fn evac, void *user);
80 #pragma GCC visibility pop
82 #endif /* RTS_USER_SIGNALS */
84 #endif /* RTSSIGNALS_H */