src/Pure/Thy/thy_info.ML
changeset 34260 2524c1bbd087
parent 33522 737589bb9bb8
child 36953 2af1ad9aa1a3
equal deleted inserted replaced
34259:2ba492b8b6e8 34260:2524c1bbd087
   387           else Future.map (fn after_load => (after_load (); fn () => ())) future;
   387           else Future.map (fn after_load => (after_load (); fn () => ())) future;
   388       in Symtab.update (name, future') tab end;
   388       in Symtab.update (name, future') tab end;
   389 
   389 
   390     val futures = fold fork tasks Symtab.empty;
   390     val futures = fold fork tasks Symtab.empty;
   391 
   391 
   392     val exns = tasks |> maps (fn (name, _) =>
   392     val failed = tasks |> maps (fn (name, _) =>
   393       let
   393       let
   394         val after_load = Future.join (the (Symtab.lookup futures name));
   394         val after_load = Future.join (the (Symtab.lookup futures name));
   395         val _ = join_thy name;
   395         val _ = join_thy name;
   396         val _ = after_load ();
   396         val _ = after_load ();
   397       in [] end handle exn => (kill_thy name; [exn]));
   397       in [] end handle exn => [(name, exn)]) |> rev;
   398 
   398 
   399   in ignore (Exn.release_all (map Exn.Exn (rev exns))) end) ();
   399     val _ = List.app (kill_thy o #1) failed;
       
   400     val _ = Exn.release_all (map (Exn.Exn o #2) failed);
       
   401   in () end) ();
   400 
   402 
   401 fun schedule_seq tasks =
   403 fun schedule_seq tasks =
   402   Graph.topological_order tasks
   404   Graph.topological_order tasks
   403   |> List.app (fn name =>
   405   |> List.app (fn name =>
   404     (case Graph.get_node tasks name of
   406     (case Graph.get_node tasks name of