system_out: threaded version does not work for 5.1;
authorwenzelm
Thu, 06 Mar 2008 20:17:51 +0100
changeset 26221 e557c20158e2
parent 26220 d34b68c21f9a
child 26222 edf6473ac9e9
system_out: threaded version does not work for 5.1;
src/Pure/ML-Systems/multithreading_polyml.ML
--- a/src/Pure/ML-Systems/multithreading_polyml.ML	Thu Mar 06 20:17:50 2008 +0100
+++ b/src/Pure/ML-Systems/multithreading_polyml.ML	Thu Mar 06 20:17:51 2008 +0100
@@ -122,7 +122,7 @@
 
 (* system shell processes, with propagation of interrupts *)
 
-fun system_out script = uninterruptible (fn restore_attributes => fn () =>
+fun system_out_threaded script = uninterruptible (fn restore_attributes => fn () =>
   let
     val script_name = OS.FileSys.tmpName ();
     val _ = write_file script_name script;
@@ -183,6 +183,10 @@
     val rc = (case ! result of Signal => raise Interrupt | Result rc => rc);
   in (output, rc) end) ();
 
+val system_out =
+  if ml_system = "polyml-5.1" then system_out  (*signals not propagated from root thread!*)
+  else system_out_threaded;
+
 
 (* critical section -- may be nested within the same thread *)