fix haddock submodule pointer
[ghc-hetmet.git] / rts / posix / OSThreads.c
index 343536e..29cb23e 100644 (file)
@@ -7,7 +7,7 @@
  *
  * --------------------------------------------------------------------------*/
 
-#if defined(__linux__)
+#if defined(__linux__) || defined(__GLIBC__)
 /* We want GNU extensions in DEBUG mode for mutex error checking */
 /* We also want the affinity API, which requires _GNU_SOURCE */
 #define _GNU_SOURCE
 #include <mach/mach.h>
 #endif
 
+#ifdef HAVE_SIGNAL_H
+# include <signal.h>
+#endif
+
 /*
  * This (allegedly) OS threads independent layer was initially
  * abstracted away from code that used Pthreads, so the functions
@@ -290,6 +294,12 @@ setThreadAffinity (nat n GNUC3_ATTRIBUTE(__unused__),
 }
 #endif
 
+void
+interruptOSThread (OSThreadId id)
+{
+    pthread_kill(id, SIGPIPE);
+}
+
 #else /* !defined(THREADED_RTS) */
 
 int