Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4
[ghc-hetmet.git] / rts / Task.h
index f91872f..38e4763 100644 (file)
@@ -225,6 +225,11 @@ INLINE_HEADER Task *myTask (void);
 //
 void startWorkerTask (Capability *cap);
 
+// Interrupts a worker task that is performing an FFI call.  The thread
+// should not be destroyed.
+//
+void interruptWorkerTask (Task *task);
+
 #endif /* THREADED_RTS */
 
 // -----------------------------------------------------------------------------
@@ -233,8 +238,9 @@ void startWorkerTask (Capability *cap);
 // A thread-local-storage key that we can use to get access to the
 // current thread's Task structure.
 #if defined(THREADED_RTS)
-#if defined(linux_HOST_OS) && \
-    (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))
+#if (defined(linux_HOST_OS) && \
+     (defined(i386_HOST_ARCH) || defined(x86_64_HOST_ARCH))) || \
+    (defined(mingw32_HOST_OS) && __GNUC__ >= 4 && __GNUC_MINOR__ >= 4)
 #define MYTASK_USE_TLV
 extern __thread Task *my_task;
 #else