X-Git-Url: http://git.megacz.com/?a=blobdiff_plain;f=ghc%2Frts%2FRtsUtils.c;h=09154da45afed6aa9eb04906e9c622baa6b026a5;hb=0181f5b8e87edbb50fbbe06efb8fca203ad535ea;hp=76eb7d1c66cd9896e36fb3a4d5a417c8f96897b1;hpb=c61f8941450284c3f33b6bd396204b2025a6f47e;p=ghc-hetmet.git diff --git a/ghc/rts/RtsUtils.c b/ghc/rts/RtsUtils.c index 76eb7d1..09154da 100644 --- a/ghc/rts/RtsUtils.c +++ b/ghc/rts/RtsUtils.c @@ -32,13 +32,12 @@ #include #include -#if defined(openbsd_TARGET_OS) -# ifdef HAVE_SIGNAL_H -# include -# endif -# ifdef HAVE_PTHREAD_H -# include -# endif +#ifdef HAVE_SIGNAL_H +#include +#endif + +#if defined(THREADED_RTS) && defined(openbsd_TARGET_OS) && defined(HAVE_PTHREAD_H) +#include #endif /* ----------------------------------------------------------------------------- @@ -298,14 +297,14 @@ heapCheckFail( void ) #endif /* - * It seems that pthreads and signals interact oddly in OpenBSD - * pthreads (and possibly FreeBSD). When linking with -lpthreads, we + * It seems that pthreads and signals interact oddly in OpenBSD & FreeBSD + * pthreads (and possibly others). When linking with -lpthreads, we * have to use pthread_kill to send blockable signals. So use that * when we have a threaded rts. So System.Posix.Signals will call * genericRaise(), rather than raise(3). */ int genericRaise(int sig) { -#if defined(THREADED_RTS) && defined(openbsd_TARGET_OS) +#if defined(THREADED_RTS) && (defined(openbsd_TARGET_OS) || defined(freebsd_TARGET_OS)) return pthread_kill(pthread_self(), sig); #else return raise(sig);