summaryrefslogtreecommitdiff
path: root/rts/posix/Signals.h
diff options
context:
space:
mode:
authorSimon Marlow <marlowsd@gmail.com>2009-02-19 10:31:42 +0000
committerSimon Marlow <marlowsd@gmail.com>2009-02-19 10:31:42 +0000
commit7ed3f7556f46b957f7efb97ed7ebdc92db2f8ab7 (patch)
tree8ea698123bfac74c5881bc5f62b5de6a145bdb84 /rts/posix/Signals.h
parent77b7c34fa24860c91f56250defa91b2d1a7a1c00 (diff)
downloadhaskell-7ed3f7556f46b957f7efb97ed7ebdc92db2f8ab7.tar.gz
Rewrite of signal-handling (ghc patch; see also base and unix patches)
The API is the same (for now). The new implementation has the capability to define signal handlers that have access to the siginfo of the signal (#592), but this functionality is not exposed in this patch. #2451 is the ticket for the new API. The main purpose of bringing this in now is to fix race conditions in the old signal handling code (#2858). Later we can enable the new API in the HEAD. Implementation differences: - More of the signal-handling is moved into Haskell. We store the table of signal handlers in an MVar, rather than having a table of StablePtrs in the RTS. - In the threaded RTS, the siginfo of the signal is passed down the pipe to the IO manager thread, which manages the business of starting up new signal handler threads. In the non-threaded RTS, the siginfo of caught signals is stored in the RTS, and the scheduler starts new signal handler threads.
Diffstat (limited to 'rts/posix/Signals.h')
-rw-r--r--rts/posix/Signals.h8
1 files changed, 6 insertions, 2 deletions
diff --git a/rts/posix/Signals.h b/rts/posix/Signals.h
index aa440b38aa..e1d550fdad 100644
--- a/rts/posix/Signals.h
+++ b/rts/posix/Signals.h
@@ -9,11 +9,15 @@
#ifndef POSIX_SIGNALS_H
#define POSIX_SIGNALS_H
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
extern rtsBool anyUserHandlers(void);
#if !defined(THREADED_RTS)
-extern StgPtr pending_handler_buf[];
-extern StgPtr *next_pending_handler;
+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