Interruptible FFI calls with pthread_kill and CancelSynchronousIO. v4
[ghc-hetmet.git] / docs / users_guide / ffi-chap.xml
index 2d2c5a0..b33e95a 100644 (file)
@@ -19,7 +19,7 @@ Foreign function interface (FFI)
 
   <para>The FFI libraries are documented in the accompanying library
   documentation; see for example the
-    <ulink url="../libraries/base/Control-Concurrent.html"><literal>Foreign</literal></ulink> module.</para>
+    <ulink url="&libraryBaseLocation;/Control-Concurrent.html"><literal>Foreign</literal></ulink> module.</para>
 
   <sect1 id="ffi-ghcexts">
     <title>GHC extensions to the FFI Addendum</title>
@@ -64,7 +64,7 @@ OK:
 </para>
       </sect2>
 
-      <sect2>
+      <sect2 id="ffi-prim">
         <title>Primitive imports</title>
        <para>
          GHC extends the FFI with an additional calling convention
@@ -476,6 +476,15 @@ int main(int argc, char *argv[])
           threads, but there may be an arbitrary number of foreign
           calls in progress at any one time, regardless of
           the <literal>+RTS -N</literal> value.</para>
+
+        <para>If a call is annotated as <literal>interruptible</literal>
+          and the program was multithreaded, the call may be
+          interrupted in the event that the Haskell thread receives an
+          exception.  The mechanism by which the interrupt occurs
+          is platform dependent, but is intended to cause blocking
+          system calls to return immediately with an interrupted error
+          code.  The underlying operating system thread is not to be
+          destroyed.</para>
       </sect3>
 
       <sect3 id="haskell-threads-and-os-threads">
@@ -498,7 +507,7 @@ int main(int argc, char *argv[])
           threads</emphasis>, which are Haskell threads tied to a
           particular OS thread.  For information on bound threads, see
           the documentation
-          for the <ulink url="../libraries/base/Control-Concurrent.html"><literal>Control.Concurrent</literal></ulink>
+          for the <ulink url="&libraryBaseLocation;/Control-Concurrent.html"><literal>Control.Concurrent</literal></ulink>
           module.</para>
       </sect3>
       
@@ -563,7 +572,6 @@ int main(int argc, char *argv[])
 
 <!-- Emacs stuff:
      ;;; Local Variables: ***
-     ;;; mode: xml ***
      ;;; sgml-parent-document: ("users_guide.xml" "book" "chapter") ***
      ;;; End: ***
  -->