summaryrefslogtreecommitdiff
path: root/math/coq/files/ide-coqide.diff
blob: 34d8affdbd188ea1111df7d2647838625ea20a85 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
--- coq-8.3/ide/coqide.ml	2010-07-24 17:57:30.000000000 +0200
+++ coq-8.3/ide/coqide.ml	2010-11-04 23:09:29.000000000 +0100
@@ -251,27 +251,29 @@
     end
 
 let do_if_not_computing text f x =
-  if Mutex.try_lock coq_computing then
-    let threaded_task () =
-      prerr_endline "Getting lock";
-      try
-        f x;
-        prerr_endline "Releasing lock";
-        Mutex.unlock coq_computing;
-      with e ->
-        prerr_endline "Releasing lock (on error)";
-        Mutex.unlock coq_computing;
-        raise e
-    in
+  let threaded_task () =
+    if Mutex.try_lock coq_computing then
+      begin
+        prerr_endline "Getting lock";
+        try
+          f x;
+          prerr_endline "Releasing lock";
+          Mutex.unlock coq_computing;
+        with e ->
+          prerr_endline "Releasing lock (on error)";
+          Mutex.unlock coq_computing;
+          raise e
+      end
+    else
+     prerr_endline
+      "Discarded order (computations are ongoing)"
+  in
       prerr_endline ("Launching thread " ^ text);
       ignore (Glib.Timeout.add ~ms:300 ~callback:
                   (fun () -> if Mutex.try_lock coq_computing
                              then (Mutex.unlock coq_computing; false)
                              else (pbar#pulse (); true)));
       ignore (Thread.create threaded_task ())
-  else
-    prerr_endline
-      "Discarded order (computations are ongoing)"
 
 (* XXX - 1 appel *)
 let kill_input_view i =