src/Pure/library.ML
changeset 23932 7afee4bf89e8
parent 23922 707639e9497d
child 23937 66e1f24d655d
--- a/src/Pure/library.ML	Mon Jul 23 16:44:59 2007 +0200
+++ b/src/Pure/library.ML	Mon Jul 23 16:45:00 2007 +0200
@@ -74,6 +74,7 @@
   val reset: bool ref -> bool
   val toggle: bool ref -> bool
   val change: 'a ref -> ('a -> 'a) -> unit
+  val setmp_noncritical: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
   val setmp: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
 
   (*lists*)
@@ -366,7 +367,7 @@
 fun change r f = r := f (! r);
 
 (*temporarily set flag during execution*)
-fun setmp flag value f x =
+fun setmp_noncritical flag value f x =
   let
     val orig_value = ! flag;
     val _ = flag := value;
@@ -374,6 +375,8 @@
     val _ = flag := orig_value;
   in release result end;
 
+fun setmp flag value f x = CRITICAL (fn () => setmp_noncritical flag value f x);
+
 
 
 (** lists **)