ignore print process even after fork, to avoid loosing active worker threads;
authorwenzelm
Fri, 09 Jan 2015 11:51:02 +0100
changeset 59328 b83d6c3c439a
parent 59327 8a779359df67
child 59329 72278d083d3a
ignore print process even after fork, to avoid loosing active worker threads;
src/Pure/PIDE/command.ML
--- a/src/Pure/PIDE/command.ML	Fri Jan 09 10:49:35 2015 +0100
+++ b/src/Pure/PIDE/command.ML	Fri Jan 09 11:51:02 2015 +0100
@@ -377,12 +377,15 @@
     else ()
   end;
 
+fun ignore_process process =
+  Lazy.is_running process orelse Lazy.is_finished process;
+
 fun run_eval execution_id (Eval {exec_id, eval_process}) =
   if Lazy.is_finished eval_process then ()
   else run_process execution_id exec_id eval_process;
 
 fun run_print execution_id (Print {name, delay, pri, exec_id, print_process, ...}) =
-  if Lazy.is_running print_process orelse Lazy.is_finished print_process then ()
+  if ignore_process print_process then ()
   else if pri <= 0 orelse (Multithreading.enabled () andalso Options.default_bool "parallel_print")
   then
     let
@@ -390,7 +393,9 @@
       fun fork () =
         ignore ((singleton o Future.forks)
           {name = name, group = SOME group, deps = [], pri = pri, interrupts = true}
-          (fn () => run_process execution_id exec_id print_process));
+          (fn () =>
+            if ignore_process print_process then ()
+            else run_process execution_id exec_id print_process));
     in
       (case delay of
         NONE => fork ()