src/Pure/library.ML
changeset 25797 b293e3ed3cad
parent 25752 374446e93558
child 25943 d431d65346a1
equal deleted inserted replaced
25796:5df3607867c1 25797:b293e3ed3cad
    63   val reset: bool ref -> bool
    63   val reset: bool ref -> bool
    64   val toggle: bool ref -> bool
    64   val toggle: bool ref -> bool
    65   val change: 'a ref -> ('a -> 'a) -> unit
    65   val change: 'a ref -> ('a -> 'a) -> unit
    66   val setmp_noncritical: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
    66   val setmp_noncritical: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
    67   val setmp: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
    67   val setmp: 'a ref -> 'a -> ('b -> 'c) -> 'b -> 'c
       
    68   val setmp_thread_data: 'a Universal.tag -> 'a -> 'a -> ('b -> 'c) -> 'b -> 'c
    68 
    69 
    69   (*lists*)
    70   (*lists*)
    70   exception UnequalLengths
    71   exception UnequalLengths
    71   val single: 'a -> 'a list
    72   val single: 'a -> 'a list
    72   val the_single: 'a list -> 'a
    73   val the_single: 'a list -> 'a
   336     val _ = flag := orig_value;
   337     val _ = flag := orig_value;
   337   in Exn.release result end;
   338   in Exn.release result end;
   338 
   339 
   339 fun setmp flag value f x = NAMED_CRITICAL "setmp" (fn () => setmp_noncritical flag value f x);
   340 fun setmp flag value f x = NAMED_CRITICAL "setmp" (fn () => setmp_noncritical flag value f x);
   340 
   341 
       
   342 fun setmp_thread_data tag orig_data data f x =
       
   343   let
       
   344     val _ = Multithreading.put_data (tag, data);
       
   345     val result = Exn.capture f x;
       
   346     val _ = Multithreading.put_data (tag, orig_data);
       
   347   in Exn.release result end;
       
   348 
   341 
   349 
   342 
   350 
   343 (** lists **)
   351 (** lists **)
   344 
   352 
   345 exception UnequalLengths;
   353 exception UnequalLengths;