root/rts/posix/Signals.h

Revision 8b75acd3ca25165536f18976c8d80cb62ad613e4, 0.8 KB (checked in by Simon Marlow <marlowsd@…>, 6 months ago)

Make forkProcess work with +RTS -N

Consider this experimental for the time being. There are a lot of
things that could go wrong, but I've verified that at least it works
on the test cases we have.

I also did some API cleanups while I was here. Previously we had:

Capability * rts_eval (Capability *cap, HaskellObj? p, /*out*/HaskellObj *ret);

but this API is particularly error-prone: if you forget to discard the
Capability * you passed in and use the return value instead, then
you're in for subtle bugs with +RTS -N later on. So I changed all
these functions to this form:

void rts_eval (/* inout */ Capability **cap,

/* in */ HaskellObj? p,
/* out */ HaskellObj? *ret)

It's much harder to use this version incorrectly, because you have to
pass the Capability in by reference.

  • Property mode set to 100644
Line 
1/* -----------------------------------------------------------------------------
2 *
3 * (c) The GHC Team, 1998-2005
4 *
5 * Signal processing / handling.
6 *
7 * ---------------------------------------------------------------------------*/
8
9#ifndef POSIX_SIGNALS_H
10#define POSIX_SIGNALS_H
11
12#ifdef HAVE_SIGNAL_H
13# include <signal.h>
14#endif
15
16#include "BeginPrivate.h"
17
18rtsBool anyUserHandlers(void);
19
20#if !defined(THREADED_RTS)
21extern siginfo_t pending_handler_buf[];
22extern siginfo_t *next_pending_handler;
23#define signals_pending() (next_pending_handler != pending_handler_buf)
24void startSignalHandlers(Capability *cap);
25#endif
26
27void ioManagerStartCap (/* inout */ Capability **cap);
28
29extern StgInt *signal_handlers;
30
31#include "EndPrivate.h"
32
33#endif /* POSIX_SIGNALS_H */
Note: See TracBrowser for help on using the browser.