X-Git-Url: http://matita.cs.unibo.it/gitweb/?a=blobdiff_plain;ds=sidebyside;f=matita%2Fmatita%2FmatitaGui.ml;h=816dd3a303aa3d1f6c18c2f5e46ca74189048e33;hb=refs%2Fheads%2Fmaster;hp=af5ea58054d29dc014dd7befb4c33013a7447de7;hpb=d2d9b78c982fffbc4df22c0a4a13cb0d845e321c;p=helm.git diff --git a/matita/matita/matitaGui.ml b/matita/matita/matitaGui.ml index af5ea5805..816dd3a30 100644 --- a/matita/matita/matitaGui.ml +++ b/matita/matita/matitaGui.ml @@ -599,6 +599,7 @@ class gui () = let source_view = script#source_view in let thread_main = fun () -> + ignore (Thread.sigmask Unix.SIG_UNBLOCK [Sys.sigvtalrm]); lock_world (); let saved_use_library= !MultiPassDisambiguator.use_library in try @@ -630,18 +631,21 @@ class gui () = with Sys.Break as e -> notify_exn source_view e); unlock_world () in - (*thread_main ();*) worker_thread := Some (Thread.create thread_main ()) in let kill_worker = - (* the following lines are from Xavier Leroy: http://alan.petitepomme.net/cwn/2005.11.08.html *) let interrupt = ref None in let old_callback = ref (function _ -> ()) in let force_interrupt n = - (* This function is called just before the thread's timeslice ends *) + (* This function is called every 1s (see Unix.setitimer call above) *) !old_callback n; + (* it may be a masked interrupt for the previous thread that arrives + late *) if Some(Thread.id(Thread.self())) = !interrupt then - (interrupt := None; raise Sys.Break) in + (interrupt := None; raise Sys.Break) + in + ignore (Thread.sigmask Unix.SIG_BLOCK [Sys.sigvtalrm]); + ignore (Unix.setitimer Unix.ITIMER_VIRTUAL {Unix.it_interval = 1.; it_value = 1.}); let _ = match Sys.signal Sys.sigvtalrm (Sys.Signal_handle force_interrupt) with Sys.Signal_handle f -> old_callback := f @@ -666,6 +670,7 @@ class gui () = ignore (adj#connect#changed (fun _ -> adj#set_value (adj#upper -. adj#page_size))); console#message (sprintf "\tMatita version %s\n" BuildTimeConf.version); + console#message (sprintf "\tStandard library location:\n\t %s\n" BuildTimeConf.new_stdlib_dir_devel); (* natural deduction palette *) main#tacticsButtonsHandlebox#misc#hide (); MatitaGtkMisc.toggle_callback