future proofs: more robust check via Future.enabled;
authorwenzelm
Fri, 12 Dec 2008 12:14:02 +0100
changeset 29088 95a239a5e055
parent 29087 40fbcea084ff
child 29089 8cffa980bd93
child 29090 bbfac5fd8d78
child 29097 68245155eb58
child 29129 9925cf74b23b
child 29212 242b0bc2172c
future proofs: more robust check via Future.enabled;
src/Pure/Isar/skip_proof.ML
src/Pure/Thy/thy_info.ML
src/Pure/goal.ML
--- a/src/Pure/Isar/skip_proof.ML	Thu Dec 11 22:53:50 2008 +0100
+++ b/src/Pure/Isar/skip_proof.ML	Fri Dec 12 12:14:02 2008 +0100
@@ -34,7 +34,7 @@
   ALLGOALS (Tactic.rtac (make_thm thy (Var (("A", 0), propT)))) st;
 
 fun prove ctxt xs asms prop tac =
-  (if ! future_scheduler then Goal.prove_future else Goal.prove) ctxt xs asms prop
+  (if Future.enabled () then Goal.prove_future else Goal.prove) ctxt xs asms prop
     (fn args => fn st =>
       if ! quick_and_dirty
       then setmp quick_and_dirty true (cheat_tac (ProofContext.theory_of ctxt)) st
--- a/src/Pure/Thy/thy_info.ML	Thu Dec 11 22:53:50 2008 +0100
+++ b/src/Pure/Thy/thy_info.ML	Fri Dec 12 12:14:02 2008 +0100
@@ -375,7 +375,7 @@
     else if Multithreading.self_critical () then
      (warning (loader_msg "no multithreading within critical section" []);
       schedule_seq tasks)
-    else if ! future_scheduler then future_schedule tasks
+    else if Future.enabled () then future_schedule tasks
     else ignore (Exn.release_all (map Exn.Exn (Schedule.schedule (Int.min (m, n)) next_task tasks)))
   end;
 
--- a/src/Pure/goal.ML	Thu Dec 11 22:53:50 2008 +0100
+++ b/src/Pure/goal.ML	Fri Dec 12 12:14:02 2008 +0100
@@ -177,7 +177,8 @@
             else err ("Proved a different theorem: " ^ string_of_term (Thm.prop_of res))
           end);
     val res =
-      if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 then result ()
+      if immediate orelse #maxidx (Thm.rep_cterm stmt) >= 0 orelse not (Future.enabled ())
+      then result ()
       else future_result ctxt' (Future.fork_background result) (Thm.term_of stmt);
   in
     Conjunction.elim_balanced (length props) res