X-Git-Url: http://matita.cs.unibo.it/gitweb/?p=helm.git;a=blobdiff_plain;f=helm%2FDEVEL%2Flablgtk%2Flablgtk_20001129-0.1.0%2FgtkThread.ml;fp=helm%2FDEVEL%2Flablgtk%2Flablgtk_20001129-0.1.0%2FgtkThread.ml;h=0000000000000000000000000000000000000000;hp=3ab577e3e41aa7a60771b9b768df05687858f33c;hb=3ef089a4c58fbe429dd539af6215991ecbe11ee2;hpb=1c7fb836e2af4f2f3d18afd0396701f2094265ff diff --git a/helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/gtkThread.ml b/helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/gtkThread.ml deleted file mode 100644 index 3ab577e3e..000000000 --- a/helm/DEVEL/lablgtk/lablgtk_20001129-0.1.0/gtkThread.ml +++ /dev/null @@ -1,33 +0,0 @@ -(* $Id$ *) - -open GtkMain - -(* We check first whether there are some event pending, and run - some iterations. We then need to delay, thus focing a thread switch. *) - -let main () = - try - let loop = (Glib.Main.create true) in - Main.loops := loop :: !Main.loops; - while Glib.Main.is_running loop do - let i = ref 0 in - while !i < 100 && Glib.Main.pending () do - Glib.Main.iteration true; - incr i - done; - Thread.delay 0.001 - done; - Main.loops := List.tl !Main.loops - with exn -> - Main.loops := List.tl !Main.loops; - raise exn - -let start = Thread.create main - -let _ = - let mutex = Mutex.create () in - let depth = ref 0 in - GtkSignal.enter_callback := - (fun () -> if !depth = 0 then Mutex.lock mutex; incr depth); - GtkSignal.exit_callback := - (fun () -> decr depth; if !depth = 0 then Mutex.unlock mutex)