src/Pure/General/position.ML
changeset 26890 f9ec18f7c0f6
parent 26882 9e824d8f4512
child 27426 c0ef698c0904
equal deleted inserted replaced
26889:ccea41fb5c39 26890:f9ec18f7c0f6
   100 (* thread data *)
   100 (* thread data *)
   101 
   101 
   102 local val tag = Universal.tag () : T Universal.tag in
   102 local val tag = Universal.tag () : T Universal.tag in
   103 
   103 
   104 fun thread_data () = the_default none (Multithreading.get_data tag);
   104 fun thread_data () = the_default none (Multithreading.get_data tag);
   105 fun setmp_thread_data pos = Library.setmp_thread_data tag (thread_data ()) pos;
   105 
       
   106 fun setmp_thread_data pos f x =
       
   107   if ! Output.debugging then f x
       
   108   else Library.setmp_thread_data tag (thread_data ()) pos f x;
   106 
   109 
   107 fun setmp_thread_data_seq pos f seq =
   110 fun setmp_thread_data_seq pos f seq =
   108   setmp_thread_data pos f seq |> Seq.wrap (fn pull => setmp_thread_data pos pull ());
   111   setmp_thread_data pos f seq |> Seq.wrap (fn pull => setmp_thread_data pos pull ());
   109 
   112 
   110 end;
   113 end;