aboutsummaryrefslogtreecommitdiff
path: root/clib/cThread.ml
diff options
context:
space:
mode:
authorMaxime Dénès2019-04-01 17:41:22 +0200
committerMaxime Dénès2019-04-03 12:01:25 +0200
commitf374b79e08e135de11def93005110a833686c5f7 (patch)
tree5b48870361b12c53f254381cbf809e2697e5e5ef /clib/cThread.ml
parentb45d4425b760b4e6346df4ea19f24d5c1e84b911 (diff)
Protect some I/O routines from SIGALRM
This is necessary to prevent Coq from sending ill-formed output in some scenarios involving `Timeout`. Co-authored-by: Enrico Tassi <Enrico.Tassi@inria.fr>
Diffstat (limited to 'clib/cThread.ml')
-rw-r--r--clib/cThread.ml4
1 files changed, 2 insertions, 2 deletions
diff --git a/clib/cThread.ml b/clib/cThread.ml
index 9e0319e8f8..5fa44b1eec 100644
--- a/clib/cThread.ml
+++ b/clib/cThread.ml
@@ -100,10 +100,10 @@ let thread_friendly_input_value ic =
(* On the ocaml runtime used in some opam-for-windows version the
* [Thread.sigmask] API raises Invalid_argument "not implemented",
* hence we protect the call and turn the exception into a no-op *)
-let protect_sigalrm f x =
+let mask_sigalrm f x =
begin try ignore(Thread.sigmask Unix.SIG_BLOCK [Sys.sigalrm])
with Invalid_argument _ -> () end;
f x
let create f x =
- Thread.create (protect_sigalrm f) x
+ Thread.create (mask_sigalrm f) x