summaryrefslogtreecommitdiff
path: root/rts/posix/Signals.h
blob: 8203f28b34f6976667e5398891f8a87733a389ef (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
/* -----------------------------------------------------------------------------
 *
 * (c) The GHC Team, 1998-2005
 *
 * Signal processing / handling.
 *
 * ---------------------------------------------------------------------------*/

#pragma once

#if defined(HAVE_SIGNAL_H)
# include <signal.h>
#endif

#include "Ticker.h"

#include "BeginPrivate.h"

bool anyUserHandlers(void);

#if !defined(THREADED_RTS)
extern siginfo_t pending_handler_buf[];
extern siginfo_t *next_pending_handler;
#define signals_pending() (next_pending_handler != pending_handler_buf)
void startSignalHandlers(Capability *cap);
#endif

void install_vtalrm_handler(int sig, TickProc handle_tick);

/* Communicating with the IO manager thread (see GHC.Conc).
 *
 * TODO: these I/O manager things are not related to signals and ought to live
 * elsewhere, e.g. in a module specifically for the I/O manager.
 */
void ioManagerWakeup (void);
#if defined(THREADED_RTS)
void ioManagerDie (void);
void ioManagerStart (void);
void ioManagerStartCap (/* inout */ Capability **cap);
#endif

extern StgInt *signal_handlers;

#include "EndPrivate.h"