src/Pure/goal.ML
changeset 51607 ee3398dfee9a
parent 51605 eca8acb42e4a
child 51608 9c01df6a9843
equal deleted inserted replaced
51606:2843cc095a57 51607:ee3398dfee9a
   142   in Output.status (implode (map (Markup.markup_only o props) markups)) end;
   142   in Output.status (implode (map (Markup.markup_only o props) markups)) end;
   143 
   143 
   144 in
   144 in
   145 
   145 
   146 fun fork_params {name, pos, pri} e =
   146 fun fork_params {name, pos, pri} e =
   147   uninterruptible (fn _ => fn () =>
   147   uninterruptible (fn _ => Position.setmp_thread_data pos (fn () =>
   148     let
   148     let
   149       val id = the_default 0 (Position.parse_id pos);
   149       val id = the_default 0 (Position.parse_id pos);
   150       val _ = count_forked 1;
   150       val _ = count_forked 1;
   151 
   151 
   152       val future =
   152       val future =
   171                        List.app (Future.error_msg pos) (ML_Compiler.exn_messages_ids exn)));
   171                        List.app (Future.error_msg pos) (ML_Compiler.exn_messages_ids exn)));
   172               val _ = count_forked ~1;
   172               val _ = count_forked ~1;
   173             in Exn.release result end);
   173             in Exn.release result end);
   174       val _ = status (Future.task_of future) [Markup.forked];
   174       val _ = status (Future.task_of future) [Markup.forked];
   175       val _ = register_forked id future;
   175       val _ = register_forked id future;
   176     in future end) ();
   176     in future end)) ();
   177 
   177 
   178 fun fork pri e =
   178 fun fork pri e =
   179   fork_params {name = "Goal.fork", pos = Position.thread_data (), pri = pri} e;
   179   fork_params {name = "Goal.fork", pos = Position.thread_data (), pri = pri} e;
   180 
   180 
   181 fun forked_count () = #1 (Synchronized.value forked_proofs);
   181 fun forked_count () = #1 (Synchronized.value forked_proofs);